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

Disabling/enabling cop on the current line or region #38

Open
asok opened this issue Apr 9, 2022 · 0 comments
Open

Disabling/enabling cop on the current line or region #38

asok opened this issue Apr 9, 2022 · 0 comments

Comments

@asok
Copy link

asok commented Apr 9, 2022

Hi, would you accept a PR with such feature? The way I see it would work like that:

  • the point is at line:
some_method rescue handle_error
  • after running the new command rubocop-disable-cops the line would looke like that:
some_method rescue handle_error # rubocop:disable Style/RescueModifier
  • after running the command rubocop-enable-cops the line would look like that:
some_method rescue handle_error

In case of multiple offences on a given line the commands would either disable or enable all of them. It could also work on a region - in such case it would disable given cops on multiple lines by adding the comments on the lines preceding and following the region.

asok added a commit to asok/rubocop-emacs that referenced this issue Apr 22, 2022
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

No branches or pull requests

1 participant