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

Rule proposal: Re-enable all disables #3001

Closed
ptarjan opened this issue Apr 4, 2016 · 2 comments
Closed

Rule proposal: Re-enable all disables #3001

ptarjan opened this issue Apr 4, 2016 · 2 comments
Labels
feature request good first issue Easy task, suitable for newcomers to the project

Comments

@ptarjan
Copy link
Contributor

ptarjan commented Apr 4, 2016

In our codebase, people sometimes don't understand that

... code ...
# rubocop:disable SomeCop
... lots of code ...

actually turns it off for the whole file and not just the next line. (There is a postfix comment form but education with a large org is harder than technical enforcement).

Can we get a cop in the same vein as Lint/UnneededDisable which requires people to re-enable the cop within X lines? I'd like X to be 1 for us :)

@bbatsov bbatsov added feature request good first issue Easy task, suitable for newcomers to the project labels Apr 10, 2016
@bbatsov
Copy link
Collaborator

bbatsov commented Apr 10, 2016

Perhaps. Although probably it'd be better if the cop would simply infer whether it should be applied to a line, a block or a class/module/method. I'd accept such a feature, but I won't be able to work on it any time soon.

@tdeo
Copy link
Contributor

tdeo commented Oct 25, 2017

I've just come across this issue. I've recently opened #4674, and just submitted this PR: #4937.

For now, the plan is only to force the presence of an enable statement at some point in the file, and I was planning to leave people responsible for the place they put it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request good first issue Easy task, suitable for newcomers to the project
Projects
None yet
Development

No branches or pull requests

3 participants