Skip to content
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

Add cop metadata #721

Merged
merged 5 commits into from Jun 10, 2020
Merged

Add cop metadata #721

merged 5 commits into from Jun 10, 2020

Conversation

Darhazer
Copy link
Member

This is the foundation to support the planned RuboCop behaviors (currently only Safe and SafeAutocorrect affect the actual behavior).

As far as I know we don't have any cops that are unsafe by design, so I've just added the versions. Now we can start also mark cops as Safe: false or SafeAutocorrect: false


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the changelog if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@bquorning
Copy link
Collaborator

I’m not sure how to review this PR.

@Darhazer
Copy link
Member Author

Basically this just follows on what was done in Rubocop, so I guess someone else from @rubocop-hq/rubocop-core can take a look.

Btw, we can use Safe and SafeAutocorrect without importing the versions, they are independent ;)

@bbatsov
Copy link
Contributor

bbatsov commented Dec 28, 2018

Looks good to me! Great work!

@bquorning
Copy link
Collaborator

Ah, could you rebase please, to get the 2.6 builds running?

@bbatsov
Copy link
Contributor

bbatsov commented Apr 29, 2019

@Darhazer I think forgot to merge this. :-)

@dgollahon
Copy link
Contributor

As far as I know we don't have any cops that are unsafe by design

I thought we had a few but I'd have to re-examine the cops to jog my memory.

@dgollahon
Copy link
Contributor

When this lands, we should add RSpec/DescribedClass to the list of unsafe autocorrects: #795.

Also, i think it might be safe if we skipped blocks by default (which , btw, maybe we should consider making the default), but it's interesting because I wonder how many cops might be safe with certain options but not others. I wonder if there should ever be a system for safe under certain conditions (though I suspect that would add too much complexity).

@dgollahon
Copy link
Contributor

We should add RSpec/PredicateMatcher to the list of unsafe autocorrects as well.

@pirj
Copy link
Member

pirj commented Jun 9, 2020

@Darhazer do you need some help on that one?

I've heard on the grapevine that RuboCop 1.0 may be released this week! 🎉

@bbatsov
Copy link
Contributor

bbatsov commented Jun 9, 2020

@pirj I'm pretty sure he won't mind help. :-)

Maxim Krizhanovski and others added 3 commits June 10, 2020 00:01
1. Description
2. Enabled
3. Exclude
4. Styles
5. Versions
6. StyleGuide
@pirj pirj requested review from bquorning and bbatsov and removed request for bquorning June 9, 2020 21:21
@pirj pirj assigned pirj and Darhazer Jun 9, 2020
@pirj
Copy link
Member

pirj commented Jun 9, 2020

image 1.0-ready ✔️

Copy link
Contributor

@bbatsov bbatsov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! The only problem I see is that the docs are still generated as markdown, instead of asciidoc, but that's an orthogonal problem. The rake task will have to be updated.

@Darhazer
Copy link
Member Author

Thank you @pirj

Now I can't approve it as I'm still the author 😂
From now on we should introduce the new cops as pending, maybe even those that are currently not released?

@bbatsov
Copy link
Contributor

bbatsov commented Jun 10, 2020

I think that's a good idea.

@pirj
Copy link
Member

pirj commented Jun 10, 2020

I'll merge while @bquorning is not looking :D

@pirj pirj merged commit 72f5b65 into master Jun 10, 2020
@pirj pirj deleted the add-metadata branch June 10, 2020 08:04
@pirj
Copy link
Member

pirj commented Jun 10, 2020

From now on we should introduce the new cops as pending, maybe even those that are currently not released?

👍

Or we can do a 2.0 release, bump the dependency to rubocop 1.0, and start following the same versioning policy. Probably with a reduced release cycle, say, 6 months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants