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

Open
bbatsov opened this Issue Jun 9, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@bbatsov
Copy link
Collaborator

bbatsov commented Jun 9, 2018

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 or nil) and cops marked this way will just produce a message on RuboCop start saying something like:

The following cops were added and you need to decided whether to enable or disable them.

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.

@bbatsov bbatsov added the enhancement label Jun 9, 2018

@bbatsov bbatsov added this to the 1.0.0 milestone Jun 9, 2018

@mikegee

This comment has been minimized.

Copy link
Contributor

mikegee commented Jun 11, 2018

This seems a bit duplicative with the VersionAdded and VersionChanged metadata. Do you think we can infer "newness" from versions?

@bbatsov

This comment has been minimized.

Copy link
Collaborator Author

bbatsov commented Jun 12, 2018

@mikegee We can infer the cop status, but we still have to set it to something different than enable or disabled IMO. I don't like the idea of having cops set as disabled by default, because than you can't differentiate if you disabled something on purpose or it's disabled simply because it's new. What exactly is going to be the Enabled state for cops introduced in 1.1, 1.2 and so on if we don't add something for this?

@mikegee

This comment has been minimized.

Copy link
Contributor

mikegee commented Jun 12, 2018

I hadn’t thought it through as much as you. That makes sense. 👍

@Vasfed

This comment has been minimized.

Copy link
Contributor

Vasfed commented Jun 29, 2018

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.

@bbatsov

This comment has been minimized.

Copy link
Collaborator Author

bbatsov commented Jul 21, 2018

@Vasfed Perhaps. Generally all of this is trivial once someone has the down the ground work in #5978.

@bbatsov bbatsov referenced this issue Sep 26, 2018

Merged

Extend cops meta data #6293

5 of 14 tasks complete
@bbatsov

This comment has been minimized.

Copy link
Collaborator Author

bbatsov commented Sep 27, 2018

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment