Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct accessor method for config in LazyRegex #1152

Merged
merged 1 commit into from Sep 23, 2018

Conversation

Mauin
Copy link
Collaborator

@Mauin Mauin commented Sep 23, 2018

This PR fixes #1122 and similar issues reported on Slack.

LazyRegex was directly accessing the config. However instead it should only access the methods defined by ConfigAware.

ConfigAware, which is a base class of Rule ensures that the config works on the correct subConfig. Using config directly however operates on the entire config of the whole RuleSet.

As this is a really easy mistake to make, which is quite hard to debug, we should make it harder to directly access the config in a Rule class to prevent similar issues in the future.

@pavlospt
Copy link
Contributor

Thanks for finding the issue! Was not aware of that internal when implementing LazyRegex!

@arturbosch arturbosch merged commit f0d0b09 into detekt:master Sep 23, 2018
@arturbosch arturbosch added this to the RC9.2 milestone Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ObjectPropertyNaming/privatePropertyPattern not loaded from configuration
4 participants