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
Introduce new cops with a special status (instead of enabled/disabled) #5979
Comments
This seems a bit duplicative with the |
@mikegee We can infer the cop status, but we still have to set it to something different than |
I hadn’t thought it through as much as you. That makes sense. 👍 |
I think we can have something like 'LockVersion' in config - and then cops from a newer non-permitted versions can switch into non-error mode, or even just become disabled and only produce a warning that new cops were added and user should consider raising locked version. |
@Darhazer I guess it makes sense for you to reap the benefits of your work on the huge metadata tasks, so I'm assigning this to you. |
@Darhazer would you be able to tackle this anytime soon or should we find someone else from @rubocop-hq/rubocop-core to work on it? It's one of the most important tasks on the way to RuboCop 1.0 and since it's not a big task it'd be nice if we wrapped it up in the next couple of releases. |
Sure. I'll do it in the next couple of weeks.
Also, since it would require copy/pasting cop names to the .rubocop.yml, perhaps a rake task to enable/disable a cop /all non-configured cops/ would be useful? |
@Darhazer The wording sounds great.
Great idea! This might also be some command-line option, but I rake task would be enough. |
@rubocop-hq/rubocop-core I won't be able to complete this at least two more weeks, so if someone wants to take it, feel free to do so |
Elaborating on @Vasfed's idea. Imagine an require:
- rubocop/cop/internal_affairs
- rubocop-performance
- rubocop-rspec
acknowledged_version:
rubocop: 0.72.0
rubocop-performance: 0.60
rubocop-rspec: 1.34.1 Imagine we set
Benefits:
|
Please disregard the above comment, I've completely missed the discussion in the related pull request and this comment. |
In Cookstyle, which is a wrapper for RuboCop, we've worked around this issue by setting the default fail level to convention and introducing all our new cops at refactor level. That way we can introduce new cops that will show up on the CLI and autocorrect, but won't fail CI builds. That allows our users to always run the latest version of our tool without constantly spending time updating their codebases when new versions are released. |
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 their 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>
Follow up of rubocop#5979. This PR shows pending status in cop status of manual. The pending status is not enabled status and may lead to misreading.
Follow up of #5979. This PR shows pending status in cop status of manual. The pending status is not enabled status and may lead to misreading.
We have to add a way to mark recently added cops as new and have the users decide themselves whether they want to enable them or not.
I think that we can have
Enabled
feature a new value (e.g.New
ornil
) and cops marked this way will just produce a message on RuboCop start saying something like:This is going to solve the commonly reported problem that RuboCop updates are very painful for end users as usually they break their builds due to new cops being added. This would allow people go just bugfixes without having to mess much with the config. Going forward we'll take a page from ESLint and enable/disable cops upstream only in major releases.
This ticket is somewhat related to #5978, as we'd use the version data in the message we print to the users.
The text was updated successfully, but these errors were encountered: