Skip to content

rubocop-git doesn't support per cop Excludes #30

@simonrand

Description

@simonrand

Adding the following to .rubocop.yml works when running rubocop, however this has no effect when running rubocop-git.

Metrics/BlockLength:
  Exclude:
    - "**/*_spec.rb"

It looks to me (correct me if I'm wrong) rubocop-git doesn't check if a file should be included on a per cop level, it only respects the AllCops Exclude value.

Given the current implementation of only checking exclusions and then passing the source to all cops (https://github.com/m4i/rubocop-git/blob/master/lib/rubocop/git/style_guide.rb#L15-L16) - I'm not sure how to easily support these per cop Excludes without completely rethinking how the cops are run - has anyone any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions