rubocop / rubocop-rspec

Code style checking for RSpec files.
https://docs.rubocop.org/rubocop-rspec
MIT License
811 stars 276 forks source link

Recursively added requirement for rubocop-rspec weirdly fails rspec checks #696

Closed javian closed 6 years ago

javian commented 6 years ago

When making some modifications to one of the Homebrew package manager repositories I stumbled upon something that I can't explain. The repo can be found here https://github.com/Homebrew/brew .

The project generally runs Rubocop in the Homebrew/Library/Homebrew directory which recursively contains 2 rubocop configuration files where the one in the test directory contains require: rubocop-rspec.

➜  Homebrew git:(rubocopadjustment) find . -name .rubocop.yml
./test/.rubocop.yml
./.rubocop.yml

With the current set up when rubocop is run in that directory it returns multiple errors looking like this An error occurred while RSpec/PredicateMatcher cop was inspecting /usr/local/Homebrew/Library/Homebrew/software_spec.rb:417:0. To see the complete backtrace run rubocop -d. for pretty much every cop that rubocop-rspec has to offer.

Running it with-d show this

An error occurred while RSpec/PredicateMatcher cop was inspecting /usr/local/Homebrew/Library/Homebrew/software_spec.rb:397:16.
undefined method `to_sym' for nil:NilClass
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/mixin/configurable_enforced_style.rb:65:in `style'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-rspec-1.29.1/lib/rubocop/cop/rspec/predicate_matcher.rb:301:in `on_send'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:58:in `block (2 levels) in trigger_responding_cops'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:106:in `with_cop_error_handling'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:57:in `block in trigger_responding_cops'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:56:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:56:in `trigger_responding_cops'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:34:in `block (2 levels) in <class:Commissioner>'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:107:in `block in on_send'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:104:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:104:in `each_with_index'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:104:in `on_send'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:107:in `block in on_send'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:104:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:104:in `each_with_index'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:104:in `on_send'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `block in on_begin'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `on_begin'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:164:in `on_block'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `block in on_begin'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `on_begin'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:100:in `on_def'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `block in on_begin'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `on_begin'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:92:in `on_class'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `block in on_begin'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:50:in `on_begin'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/ast/traversal.rb:13:in `walk'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:46:in `investigate'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/team.rb:115:in `investigate'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/team.rb:103:in `offenses'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/team.rb:44:in `inspect_file'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:269:in `inspect_file'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:216:in `block in do_inspection_loop'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:248:in `block in iterate_until_no_changes'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:241:in `loop'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:241:in `iterate_until_no_changes'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:212:in `do_inspection_loop'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:115:in `block in file_offenses'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:133:in `file_offense_cache'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:113:in `file_offenses'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:101:in `process_file'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:78:in `block in each_inspected_file'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:75:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:75:in `reduce'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:75:in `each_inspected_file'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:67:in `inspect_files'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/runner.rb:39:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cli.rb:157:in `execute_runner'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cli.rb:85:in `execute_runners'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cli.rb:41:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/exe/rubocop:13:in `block in <top (required)>'
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/exe/rubocop:12:in `<top (required)>'
/usr/local/bin/rubocop:23:in `load'
/usr/local/bin/rubocop:23:in `<main>'

It only barfs on the files matching the pattern **/*_rspec.rb that are not in rspec format (ie. outside the test/ directory)

➜  Homebrew git:(rubocopadjustment) gfind . -name *_spec.rb
./extend/os/software_spec.rb
./extend/os/linux/software_spec.rb
./software_spec.rb

So far so good... (or so you might think).

To try and troubleshoot this I tried moving the require: rubocop-rspec line to the .rubocop.yml that's in the directory above the test/ dir where the rubocop command is executed and lo and behold rubocop executes without any issues.

➜  Homebrew git:(rubocopadjustment) ✗ grep -R "require: rubocop-rspec" .*
.rubocop.yml:require: rubocop-rspec
➜  Homebrew git:(rubocopadjustment) ✗ rubocop --parallel
Inspecting 702 files
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................C................................................................................................................................................................................................................................................................

Offenses:

test/cask/cmd/create_spec.rb:16:5: C: Avoid stubbing using allow_any_instance_of.
    allow_any_instance_of(described_class).to receive(:exec_editor)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

702 files inspected, 1 offense detected
➜  Homebrew git:(rubocopadjustment) ✗

Here you can see that the require line has been moved and rubocop executes without problems so this problem only occurs when the require line it sits in a subdirectory .rubocop.yml.

I'm currently using the latest of both rubocop* gems

rubocop (0.59.2, 0.59.1, 0.58.0)
rubocop-rspec (1.29.1)

Is this a proper problem or am I doing something wrong ?

bquorning commented 6 years ago

This does indeed sound interesting. I would like to help investigate if this is a bug on our side.

Running it with-d show this

I have made a shallow clone (git clone --depth 1) of the homebrew repository, but I cannot immediately figure out how you execute RuboCop. I see it is present in the Gemfile in Library/Homebrew/test, but I assume you are running the command somehow from the Library/Homebrew folder?

Can you show me which command to run in the repository, to get the error you’re seeing. Thanks.

javian commented 6 years ago

Homebrew itself uses two commands to run tests using rubocop brew style https://github.com/Homebrew/brew/blob/master/Library/Homebrew/style.rb and brew tests which uses amongst other things such as the gemfile you mentioned and has its own ruby version with a gem repository. brew style in its current form is not affected since it uses --config to load a single config which I'm about to change in the https://github.com/Homebrew/brew/pull/5043 .

This is however not relevant to how I run it at the moment since I'm using the regular rubocop executable from the gem so imagine I've simply ran gem install rubocop rubocop-rspecand then do

➜  Homebrew git:(master) ✗ pwd
/usr/local/Homebrew/Library/Homebrew
➜  Homebrew git:(master) ✗ rubocop -d
For /usr/local/Homebrew/Library/Homebrew: configuration from /usr/local/Homebrew/Library/Homebrew/.rubocop.yml
Inheriting configuration from /usr/local/Homebrew/Library/.rubocop.yml
Default configuration from /usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/config/default.yml
Inheriting configuration from /usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/config/enabled.yml
Inheriting configuration from /usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/config/disabled.yml
AllCops/Exclude configuration from /usr/local/Homebrew/Library/.rubocop.yml
For /usr/local/Homebrew/Library/Homebrew/test/support/fixtures/cask: configuration from /usr/local/Homebrew/Library/Homebrew/test/.rubocop.yml
configuration from /usr/local/lib/ruby/gems/2.5.0/gems/rubocop-rspec-1.29.1/config/default.yml
configuration from /usr/local/lib/ruby/gems/2.5.0/gems/rubocop-rspec-1.29.1/config/default.yml
Inheriting configuration from /usr/local/Homebrew/Library/Homebrew/.rubocop.yml
Inheriting configuration from /usr/local/Homebrew/Library/.rubocop.yml
Inheriting configuration from /usr/local/Homebrew/Library/Homebrew/test/.rubocop_todo.yml
AllCops/Exclude configuration from /usr/local/Homebrew/Library/.rubocop.yml
Unprocessable file /usr/local/Homebrew/Library/Homebrew/test/support/fixtures/elf/hello: ArgumentError, invalid byte sequence in UTF-8
Inspecting 702 files
Scanning /usr/local/Homebrew/Library/Homebrew/reinstall.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/update_migrator.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/PATH.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/commands.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/formula_assertions.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/pkg_version.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/dependencies.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/descriptions.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/brew.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/install_renamed.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/keg_relocate.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/load_path.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/install.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/help.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/formula_installer.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/tab.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/metafiles.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/migrator.rb
.Scanning /usr/local/Homebrew/Library/Homebrew/software_spec.rb
An error occurred while FactoryBot/CreateList cop was inspecting /usr/local/Homebrew/Library/Homebrew/software_spec.rb:1:0.
undefined method `to_sym' for nil:NilClass
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/mixin/configurable_enforced_style.rb:65:in `style'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-rspec-1.29.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:58:in `on_send'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:58:in `block (2 levels) in trigger_responding_cops'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:106:in `with_cop_error_handling'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:57:in `block in trigger_responding_cops'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:56:in `each'
/usr/local/lib/ruby/gems/2.5.0/gems/rubocop-0.59.2/lib/rubocop/cop/commissioner.rb:56:in `trigger_responding_cops'
(I've removed the rest here, can include it if necessary)
bquorning commented 6 years ago

I get an error about some missing “backports” file when running RuboCop:

Library/Homebrew ‹2.5.1p57› ‹master› » pwd
/Users/bquorning/Code/homebrew/Library/Homebrew
Library/Homebrew ‹2.5.1p57› ‹master› » rubocop
cannot load such file -- backports/2.4.0/string/match
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/bquorning/Code/homebrew/Library/Homebrew/extend/string.rb:2:in `<top (required)>'
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/bquorning/Code/homebrew/Library/Homebrew/rubocops/extend/formula_cop.rb:10:in `<top (required)>'
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/bquorning/Code/homebrew/Library/Homebrew/rubocops/formula_desc_cop.rb:1:in `<top (required)>'
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/bquorning/Code/homebrew/Library/Homebrew/rubocops.rb:3:in `<top (required)>'
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_loader_resolver.rb:13:in `block in resolve_requires'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_loader_resolver.rb:11:in `each'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_loader_resolver.rb:11:in `resolve_requires'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_loader.rb:43:in `load_file'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_loader_resolver.rb:139:in `block in base_configs'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_loader_resolver.rb:138:in `map'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_loader_resolver.rb:138:in `base_configs'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_loader_resolver.rb:22:in `resolve_inheritance'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_loader.rb:49:in `load_file'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_loader.rb:82:in `configuration_from_file'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/config_store.rb:44:in `for'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/cli.rb:187:in `apply_default_formatter'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/lib/rubocop/cli.rb:40:in `run'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/exe/rubocop:13:in `block in <top (required)>'
/Users/bquorning/.rubies/ruby-2.5.1/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
/Users/bquorning/.gem/ruby/2.5.1/gems/rubocop-0.59.2/exe/rubocop:12:in `<top (required)>'
/Users/bquorning/.gem/ruby/2.5.1/bin/rubocop:23:in `load'
/Users/bquorning/.gem/ruby/2.5.1/bin/rubocop:23:in `<main>'
javian commented 6 years ago

gem install backports should take care of that

bquorning commented 6 years ago

This indeed is a strange problem. I would recommend against using require in folder specific RuboCop configuration files. Would that be an ok workaround – to move require: rubocop-rspec into the topmost .rubocop.yml file?

bquorning commented 6 years ago

You might also want to tweak the configuration for AllCops/RSpec/Patterns (https://github.com/rubocop-hq/rubocop-rspec/blob/master/config/default.yml#L2-L6) to only find _spec.rb files in your test folder.

javian commented 6 years ago

I guess that would be the only way to move forward. I would also assume that adding the pattern would also solve the issue since the error only only triggers on files outside of the test/directory.

javian commented 6 years ago

It seems to work just fine. I didn't quite get why you recommend against using require in a folder specific config file though - can you elaborate on that a bit ?

javian commented 6 years ago

Hmm, I probably need to push it up even one more level in the directory tree since the root config is in the Library directory.

bquorning commented 6 years ago

I didn't quite get why you recommend against using require in a folder specific config file though - can you elaborate on that a bit ?

Only to avoid confusion. Using the require in a folder specific file may lead one to believe that it only applies to the files in that folder – while in fact the required library applies to all files in the project.

bquorning commented 6 years ago

It sounds like we found a way to solve the problem, so I’m going to close this issue. Feel free to reopen if you still have issues, or think this should be resolved in another way.