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
implement Style/DisableCopsWithinSourceCodeDirective cop #7384
implement Style/DisableCopsWithinSourceCodeDirective cop #7384
Conversation
0cf2768
to
1c85f00
Compare
I like the spirit of the change, but I'm not sure if this should be a cop or some global config in RuboCop. @jonas054 What do you think on the subject? |
I love the idea! In fact, I argued rather stubbornly for implementing this kind of functionality in a cop back in #900, but I was overruled and and the So, I like the cop and the changes look good (had some minor comments), and I would like to see the |
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.
Looks good overall.
lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb
Outdated
Show resolved
Hide resolved
lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb
Outdated
Show resolved
Hide resolved
21f3e13
to
40a4e7d
Compare
Removed |
b15611c
to
bd3d7e9
Compare
Amazing memory! I had totally forgotten about this!
Agreed! |
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.
Looks good apart from one issue in the changelog.
6394a57
to
f94d3e0
Compare
f94d3e0
to
8167c38
Compare
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.
👍
Follow rubocop#7384, rubocop#7857, and rubocop#7869. This PR fixes the next release version with 0.82 because RuboCop 0.81 has been released. This version (0.82) is based on rubocop#7851.
This cop forbids enabling or disabling cops within source code with comments like:
# rubocop:disable Style/EmptyBlockParameter
The motivation behind it is to make sure developers fix the issues reported by rubocop and not quickly add comments to ignore them.
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.