Skip to content

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

@asok

Description

@asok

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions