Things to check at work:
- Is the rubocop.yml actually in the installed gem? It may be, that it hasn't been included in the install version.
- Is there a
~/.rubocop.yml
with the same content? - Is Rubocop up-to-date?
~/.rubocop.yml
:
Metrics/LineLength:
Max: 100
$ bundle exec rubocop -d config/application.rb
For /home/phansch/code/rails_playground: configuration from /home/phansch/code/rails_playground/.rubocop.yml
Inheriting configuration from /home/phansch/.rvm/gems/ruby-2.4.1/bundler/gems/rubocop-bug-gem-edf3b83692c7/rubocop.yml
/home/phansch/.rvm/gems/ruby-2.4.1/bundler/gems/rubocop-bug-gem-edf3b83692c7/rubocop.yml: Style/LineLength has the wrong namespace - should be Metrics
Default configuration from /home/phansch/.rvm/gems/ruby-2.4.1/gems/rubocop-0.48.1/config/default.yml
Inheriting configuration from /home/phansch/.rvm/gems/ruby-2.4.1/gems/rubocop-0.48.1/config/enabled.yml
Inheriting configuration from /home/phansch/.rvm/gems/ruby-2.4.1/gems/rubocop-0.48.1/config/disabled.yml
AllCops/Exclude configuration from /home/phansch/.rubocop.yml
Inspecting 1 file
Scanning /home/phansch/code/rails_playground/config/application.rb
.
1 file inspected, no offenses detected
Finished in 0.1449760969990166 seconds
$ bundle exec rubocop -d config/application.rb
For /home/phansch/code/rails_playground: configuration from /home/phansch/code/rails_playground/.rubocop.yml
Inheriting configuration from /home/phansch/.rvm/gems/ruby-2.4.1/bundler/gems/rubocop-bug-gem-faa56588b7ef/rubocop.yml
/home/phansch/.rvm/gems/ruby-2.4.1/bundler/gems/rubocop-bug-gem-faa56588b7ef/rubocop.yml: Style/EmptyLines has the wrong namespace - should be Layout
Default configuration from /home/phansch/.rvm/gems/ruby-2.4.1/gems/rubocop-0.49.0/config/default.yml
Inheriting configuration from /home/phansch/.rvm/gems/ruby-2.4.1/gems/rubocop-0.49.0/config/enabled.yml
Inheriting configuration from /home/phansch/.rvm/gems/ruby-2.4.1/gems/rubocop-0.49.0/config/disabled.yml
AllCops/Exclude configuration from /home/phansch/.rubocop.yml
Inspecting 1 file
Scanning /home/phansch/code/rails_playground/config/application.rb
.
1 file inspected, no offenses detected
Finished in 0.09542520699324086 seconds
I had some time to dig into the config loading code, and it seems to be caused by making the excludes absolute in
Config#make_excludes_absolute
somewhere.The excludes should be relative to the project that is including the configuration and not relative to the shared gem's path.
Need to figure out why it is working at home an not working at work...
Possible causes: base_dir_for_path_parameters
I guess at home it returns Dir.pwd for some reason