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
Extend cop metadata #5978
Comments
Oh, I forgot the most important metadata.
We'll use those two pieces of metadata to add options to run only safe cops or only safe auto-corrections. Again the real work here is just going through all the cops to fill the data in. Guess we can just assume that by default everything is safe unless marked otherwise to reduce the amount of work needed here. |
This one sounds interesting, and doable. Also, it shouldn’t be that hard to write a script to find the How would so consider handling cases where you need multiple |
I think in practice we need just the last one. |
@rubocop-hq/rubocop-core @Darhazer Our volunteer for this just pulled out of it and it's probably the most important ticket we have to resolve in the direction of RuboCop 1.0 (as it blocks everything related to using this metadata). Would one of you like to tackle this? The task is pretty simple and you don't really need to dig through all the versions - it'd be fine if those are filled just for the last release and fallback to |
Same with the Safe data - we just need to put the support for it, fallback to "everything's safe" and fill in the data as we go. And update the manual generation script, of course. |
I'll take on this |
Thanks, Max! Much appreciated! |
I've done a bit of archeology and have some questions:
|
It only contains cops that have custom configuration options.
Very much in favour. The split configuration was confusing to me at first, and keeps annoying me on a regular basis. 😬 |
All should be moved to default. The enabled/disabled files are just remnants of the very first days of the project where cops didn't have any config/metadata and those files were the way to figure out if some cop should be enabled or not. We should have removed them a very long time ago...
Yes. Any config changes count towards it.
If something was truly renamed (like we've done in the past) it should be just VersionAdded for the renamed cop. After the metadata is introduced it will be
Yes.
Yes. |
Amazing work @Darhazer! 🙇 There's another small remnant still there, I think. We used to have a few |
I just tried the latest default config with the latest version of rubocop, and I'm getting a bunch of warnings
Any ideas on why this is happening? |
@ilyakatz Because the new metadata as added after 0.59.2. :-) There's no released version that supports it yet - 0.60 will be the first one when we cut it. |
ha, got it, i jumped them gun. will wait for it to come out. thanks |
Each cop should gain the following additional metadata:
VersionAdded
- the RuboCop version in which it was addedVersionChanged
- the RuboCop version in which it was changed in a user-impacting way (new config, updated defaults, etc)VersionRemoved
- the RuboCop version in which the cop was removed for whatever reason.Those will be pretty useful for the documentation (so the manual generation has to be enhanced to include them) and keeping track of changes. Adding the fields is easy - the real work is going to be populating this metadata for existing cops (I guess this will happen gradually).
The text was updated successfully, but these errors were encountered: