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
First off, thanks for starting a minitest-specific repo! I'm very excited to incorporate this into our Rubocop install. I've noticed that while the current gems are already useful, there's a configuration conflict that's preventing us from being able to use this in its current state.
Expected behavior
Adding the line
require:
- rubocop-minitest
...
should not impact the configuration of existing cops.
Actual behavior
When adding the above line, rubocop ceases to run on any files outside of our /test/ directory. It appears that this configuration is overriding the default configuration for all rubocop gems.
Steps to reproduce the problem
See repo here for a simple reproduction of the issue.
When commenting out the line to include rubocop-minitest, you'll see that the base rubocop gems run on 3 files (Gemfile, lib/sample.rb, and test/sample_test.rb).
$ [bundle exec] rubocop
Inspecting 3 files
.CC
Offenses:
lib/sample.rb:1:1: C: Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
class Sample
^
test/sample_test.rb:1:1: C: Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
class SampleTest < Minitest::Test
^
test/sample_test.rb:2:1: C: Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body beginning.
3 files inspected, 3 offenses detected
But when you uncomment the line, even the base rubocop cops only runs on test/sample_test.rb.
$ [bundle exec] rubocop
Inspecting 1 file
C
Offenses:
test/sample_test.rb:1:1: C: Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
class SampleTest < Minitest::Test
^
test/sample_test.rb:2:1: C: Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body beginning.
1 file inspected, 2 offenses detected
The text was updated successfully, but these errors were encountered:
tayjohno
changed the title
Requiring 'rubocop-minitest' in config limits _all_ cops to only run on the /test directory
Requiring 'rubocop-minitest' in config limits all cops to only run on the test/ directory
Sep 23, 2019
…meter
Fixesrubocop#13.
This PR fixes an issue that all cops only executed test directory.
Only test directory should be executed by Minitest department.
First off, thanks for starting a minitest-specific repo! I'm very excited to incorporate this into our Rubocop install. I've noticed that while the current gems are already useful, there's a configuration conflict that's preventing us from being able to use this in its current state.
Expected behavior
Adding the line
should not impact the configuration of existing cops.
Actual behavior
When adding the above line, rubocop ceases to run on any files outside of our
/test/
directory. It appears that this configuration is overriding the default configuration for all rubocop gems.Steps to reproduce the problem
See repo here for a simple reproduction of the issue.
https://github.com/tayjohno/sample-rubocop-minitest-issue
When commenting out the line to include
rubocop-minitest
, you'll see that the base rubocop gems run on 3 files (Gemfile
,lib/sample.rb
, andtest/sample_test.rb
).But when you uncomment the line, even the base rubocop cops only runs on
test/sample_test.rb
.RuboCop version
The text was updated successfully, but these errors were encountered: