-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Support style-guide only usage #1454
Conversation
Coverage increased (+0.23%) when pulling 321a2efc6bd33584c909fb1809935af706d11a39 on marxarelli:feature/only-guide-cops into f1f70ef on bbatsov:master. |
end | ||
|
||
option(opts, '--only-guide-cops') do | ||
@options[:only_guide_cops] = true |
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.
Since it's a boolean option, it will work without the block, just like --show-cops
or --fail-fast
.
👍 I like the idea. Had some minor comments. |
@jonas054 Thanks for the feedback! I'll take a look at ironing out the outstanding issues. |
I like the idea, would let one easily adhere to a given guide/recommendation. Thanks! |
@marxarelli About |
@bbatsov @yujinakayama ping |
Looks good to me. Update the changelog and squash the commits into one. |
I like this idea a lot as well! 👍 Thanks a lot to everybody contributing to RuboCop! |
236d56a
to
bb139a0
Compare
@bbatsov Done. Thanks for accepting this! (That's assuming everything goes well with Travis which I can't verify due to the ongoing DDoS against DNSimple.) |
@@ -10,6 +10,7 @@ | |||
|
|||
* [#801](https://github.com/bbatsov/rubocop/issues/801): New style `context_dependent` for `Style/BracesAroundHashParameters` looks at preceding parameter to determine if braces should be used for final parameter. ([@jonas054][]) | |||
* [#1427](https://github.com/bbatsov/rubocop/issues/1427): Excluding directories on the top level is now done earlier, so that these file trees are not searched, thus saving time when inspecting projects with many excluded files. ([@jonas054][]) | |||
* [#1454](https://github.com/bbatsov/rubocop/issues/1454): New `--only-guide-cops` and `AllCops/StyleGuideCopsOnly` options that will only enforce cops that link to a style guide. ([@marxarelli][]) |
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.
This should be in "new features".
You should also rebase this on top of the current |
bb139a0
to
e373d8a
Compare
Another merge conflict. :( You'll have to rebase again. |
Many cops that have been implemented and enabled by default have no correlation to a style-guide rule: `Metrics/ClassLength`, `Metrics/AbcSize`, `Metrics/PerceivedComplexity` just to name a few. In cases where these cops find violations, there's little recourse as the rules cannot be traced back to a meaningful discussion or consensus. The `--only-guide-cops` and `AllCops/StyleGuideCopsOnly` options give users an easy method of invoking RuboCop in a way that's more congruent with the rules of the style guide. Working around `GuardClause` violation in `Runner#filter_cop_classes`.
e373d8a
to
75140c0
Compare
👍 |
Thanks! |
Many cops that have been implemented and enabled by default have no
correlation to a style-guide rule:
Metrics/ClassLength
,Metrics/AbcSize
,Metrics/PerceivedComplexity
just to name a few. Incases where these cops find violations, there's little recourse as the
rules cannot be traced back to a meaningful discussion or consensus.
The
--only-guide-cops
andAllCops/StyleGuideCopsOnly
options giveusers an easy method of invoking RuboCop in a way that's more congruent
with the rules of the style guide.