Support rubocop-airbnb plugin
I'm trying to add codeclimate.yml but I'm having problems with rubocop engine.
This is my codeclimate.yml:
version: 2 # required to adjust maintainability checks
checks:
argument-count:
enabled: true
complex-logic:
enabled: true
file-lines:
enabled: true
identical-code:
enabled: true
method-complexity:
enabled: true
method-count:
enabled: true
method-lines:
enabled: true
nested-control-flow:
enabled: true
return-statements:
enabled: true
similar-code:
enabled: true
exclude_patterns:
- "config/"
- "db/"
- "**/node_modules/"
- "**/vendor/"
- "**/*_test.go"
- "**/*.d.ts"
plugins:
brakeman:
enabled: true
csslint:
enabled: true
eslint:
enabled: true
config:
config: .eslintrc
reek:
enabled: true
rubocop:
enabled: true
config:
file: .rubocop.yml
scss-lint:
enabled: true
And this is my rubocop.yml:
require: rubocop-airbnb
inherit_from: .rubocop_airbnb.yml
I have installed rubocop-airbnb gem (Source) and its declared on my Gemfile.
Running codeclimage analyze gives the following output:
/usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:122:in `require': cannot load such file -- rubocop-airbnb (LoadError)
from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:122:in `require'
from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_loader_resolver.rb:15:in `block in resolve_requires'
from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_loader_resolver.rb:11:in `each'
from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_loader_resolver.rb:11:in `resolve_requires'
from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_loader.rb:38:in `load_file'
from /usr/local/bundle/gems/rubocop-0.52.1/lib/rubocop/config_store.rb:23:in `options_config='
from /usr/src/app/lib/cc/engine/rubocop.rb:55:in `block in config_store'
from /usr/src/app/lib/cc/engine/rubocop.rb:53:in `tap'
from /usr/src/app/lib/cc/engine/rubocop.rb:53:in `config_store'
from /usr/src/app/lib/cc/engine/rubocop.rb:46:in `files_to_inspect'
from /usr/src/app/lib/cc/engine/rubocop.rb:29:in `block in run'
from /usr/src/app/lib/cc/engine/rubocop.rb:28:in `chdir'
from /usr/src/app/lib/cc/engine/rubocop.rb:28:in `run'
from /usr/src/app/bin/codeclimate-rubocop:17:in `<main>'
Any ideas about this?
Code Climate plugins run in isolated environments and can't install gems or use gems installed for the repositories they're analyzing. This is a security feature that does unfortunately limit the flexibility of plugins to use their own third party plugins.
In some cases we do package libraries like this along with the plugin, we may be able to consider doing that in this case.
Thanks for the help @wfleming! It would be awesome if you consider to package this library into the plugin.
You can close this issue.
I'll leave it open to track the desire to support the gem, thanks for getting back to me.
just came to open the same ticket - having the matching rubocop-airbnb package installed alongside rubocop would be awesome.
would a pr help on this?
Lots of people will soon have the same problem with rubocop-rails.
@Manfred rubocop-rails is already supported:
https://github.com/codeclimate/codeclimate-rubocop/issues/178
Any movement on this? My team is using the Airbnb Rubocop standard to develop and code climate as a part of our CI. Not being able to add this third party plugin means our CI rubocop is on a different standard than our local dev one which isn’t really tenable.
@filipesperandio would you accept a PR that adds rubocop-airbnb?
@filipesperandio would you accept a PR that adds rubocop-airbnb?
sorry, missed this.
@britneywright just looked into it and found some possible mismatches regarding different versions on both sides. Maybe we can do this in an specific channel, as she suggested.
Just to cross-post, I submitted a PR to upgrade packages in rubocop-airbnb that may help this along: https://github.com/airbnb/ruby/pull/178