You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Lint/UnneededDisable does not honor the excludes
Expected behavior
I would expect that if I explicitly exclude a file or set of files from the this cop then that cop will not trigger an error.
Actual behavior
Cop triggers an error on explicitly excluded files.
Steps to reproduce the problem
Create a file with an unnecessarily disabled rule:
# Disable style cop to enable metadata DSL to line up for readability
# rubocop:disable Style/SingleSpaceBeforeFirstArg
#
foo 'qux'
bar 'quux'
baz 'garply'
Exclude the file in your configuration:
Lint/UnneededDisable:
Exclude:
- '**/metadata.rb'
Output from a run:
bundle exec rubocop -c /tmp/github/exclude.yml -D /tmp/github/metadata.rb
Inspecting 1 file
W
Offenses:
/tmp/github/metadata.rb:2:1: W: Lint/UnneededDisable: Unnecessary disabling of Style/SingleSpaceBeforeFirstArg (did you mean Style/SpaceBeforeFirstArg?).
# rubocop:disable Style/SingleSpaceBeforeFirstArg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 file inspected, 1 offense detected
Note that if the rule is globally disabled, it will not execute the cop. So, it seems to just not be honoring the excludes.
The Lint/UnneededDisable does not honor the excludes
Expected behavior
I would expect that if I explicitly exclude a file or set of files from the this cop then that cop will not trigger an error.
Actual behavior
Cop triggers an error on explicitly excluded files.
Steps to reproduce the problem
Create a file with an unnecessarily disabled rule:
Exclude the file in your configuration:
Output from a run:
Note that if the rule is globally disabled, it will not execute the cop. So, it seems to just not be honoring the excludes.
RuboCop version
bundle exec rubocop -V
0.39.0 (using Parser 2.3.0.7, running on ruby 2.1.6 x86_64-linux)
The text was updated successfully, but these errors were encountered: