rubocop-git
rubocop-git copied to clipboard
Use absolute path to support Cop Exclude param
When Exclude param is used for a cop, ie:
Metrics/BlockLength:
Exclude:
- 'spec/**/*.rb'
Rubocop internally checks these strings using the match_pattern? method
and since the pattern arg is given as project root + pattern, it never
works for relative paths. It would, however, work for a path defined as
regexp, ie:
Metrics/BlockLength:
Exclude:
- !ruby/regexp /spec\/.*\/.*_spec.rb$/
however I think it's convenient to support string paths in order to allow '**' pattern as well.
@blelump what is the status of this?
@madslundholmdk , what do you mean?
@blelump why isn't this merged yet?
@madslundholmdk , this is just my PR for a particular problem :-) . Whether the PR will be merged or not eventually , depends on the repo owner (which I am not).
@m4i can this be merged? I just tested it, and it fix my issue #38
@m4i this change worked for me too. Do you need any help to merge this?
For now I'm using specific_install to use this fix:
gem specific_install -l [email protected]:blelump/rubocop-git.git -r 79a6579b7ebbd82890c32f536fe78472fe816071
I just switched my config to use the regex from the OP...not sure what downsides might be though 🤷♂