-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[Fix #4247] Add AllCops/IncludeOnly config parameter #5847
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
Conversation
This feature makes it possible to add RuboCop inspection slowly in a legacy project. Files and directories can be added for inspection incrementally. It's an alternative or complement to the existing workflow of adding cops one at a time using the --auto-gen-config feature.
608e5a3 to
2f27aa6
Compare
|
Hmm, I'm on the fence about this one, mostly about the naming. I have a feeling many people will not easily get the difference between |
|
There was an alternative idea mentioned in #4247, which is a boolean |
|
Hmmm, that might be better I guess. Now I just have to remember what did we include by default. :D |
|
There's another option of course - make the implicit includes explicit. That solves the problem that we're supposed to solve and doesn't require a new boolean option. |
|
I think that would mean that users who override |
|
Yeah, I'm aware of this, but I'd rather fix a bad default now rather than make a pretty complex config even more complex. At least this is my perspective. I highly doubt that many people are overriding this, and we can always issue some warning if |
|
Good! I'll be happy to get rid of the duplication between for example TargetFinder.RUBY_FILENAMES and AllCops/Include. What about extensionless files with a ruby hashbang? Because the point of this issue here is to get rid of finding files by default. We would have to add a parameter for recognized ruby interpreters. |
|
That's fine by me - the fewer the hardcoded things, the better. |
Before this change, we were hard-coding file extensions, file names, and ruby interpreters, and then adding configured includes from AllCops/Include. Now we add the parameter AllCops/RubyInterpreters and add **/*.rb to AllCops/Include. By removing the hard-coded lists of things to inspect, this feature makes it possible to introduce RuboCop inspection slowly in a legacy project. Files and directories can be added for inspection incrementally. It's an alternative or complement to the existing workflow of adding cops one at a time using the --auto-gen-config feature. Closes rubocop#5847, which was my first attempt at a fix for rubocop#4247.
Before this change, we were hard-coding file extensions, file names, and ruby interpreters, and then adding configured includes from AllCops/Include. Now we add the parameter AllCops/RubyInterpreters and add **/*.rb to AllCops/Include. By removing the hard-coded lists of things to inspect, this feature makes it possible to introduce RuboCop inspection slowly in a legacy project. Files and directories can be added for inspection incrementally. It's an alternative or complement to the existing workflow of adding cops one at a time using the --auto-gen-config feature. Closes #5847, which was my first attempt at a fix for #4247.
This feature makes it possible to add RuboCop inspection slowly in a legacy project. Files and directories can be added for inspection incrementally.
It's an alternative or complement to the existing workflow of adding cops one at a time using the
--auto-gen-configfeature.