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
[Fix #5979] Introduce cops with special status #7567
Conversation
# Configuration parameters: CountComments. | ||
Metrics/ClassLength: | ||
Max: 183 | ||
Max: 197 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that, but it feels that I might get into a refactoring spiral if I touch ConfigLoader.
@@ -91,7 +91,9 @@ def configuration_from_file(config_file) | |||
else | |||
add_excludes_from_files(config, config_file) | |||
end | |||
merge_with_default(config, config_file) | |||
merge_with_default(config, config_file).tap do |merged_config| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge_with_default
does not mutate first argument, but rather returns merged config, so I was between tap
and using a temporary local variable.
I guess they should override the new |
A couple of more things:
|
@pirj Any chance you'll be wrapping this one soon? I'm wondering whether to cut a new release now or wait for this PR. |
@bbatsov Current status and a couple of questions:
I have some time this week to address this, but if something else pops up, this might take longer, so it's better to postpone to the next release. |
Well, I think that's an orthogonal problem that has to be fixed separately. This setting dates back from a time where there were almost no extensions.
Yeah, I agree.
👍
Some small section on the subject would be useful indeed. |
Previously, new cops were introduced as either enabled or disabled. The ones enabled were bothering users with new offences, while disabled cops were often left out and remained under radars, while still being useful. By introducing this special status, users have to decide how to handle new cops, by explicitly enabling or disabling them. Cops are to be introduced with pending status between major releases of RuboCop and its extensions, and they eventually become enabled or disabled on major releases. Co-authored-by: Phil Pirozhkov <hello@fili.pp.ru>
@bbatsov All green. Please take a look if something needs to be added. |
There's one very nasty thing that I've noticed about |
Looks good to me. Thanks for bringing this across the finish line! |
Happy to move this forward 👍 |
New cops, introduced or significantly changed between major versions, are introduced with
pending
status. This is done to avoid frustration over numerous offences during updates between minor versions. RuboCop will emit a warning that new cops were introduced, and suggest to explicitly enable or disable them in the user configuration file.Based on #7184
Fixes #5979
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.