Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support rubocop-airbnb plugin #131

Open
BernardoMG opened this issue Aug 27, 2018 · 11 comments
Open

Support rubocop-airbnb plugin #131

BernardoMG opened this issue Aug 27, 2018 · 11 comments
Assignees

Comments

@BernardoMG
Copy link

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?

@wfleming
Copy link
Contributor

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.

@BernardoMG
Copy link
Author

Thanks for the help @wfleming! It would be awesome if you consider to package this library into the plugin.

You can close this issue.

@wfleming
Copy link
Contributor

I'll leave it open to track the desire to support the gem, thanks for getting back to me.

@modosc
Copy link

modosc commented Sep 7, 2018

just came to open the same ticket - having the matching rubocop-airbnb package installed alongside rubocop would be awesome.

@wfleming wfleming changed the title Rubocop engine build failed Support rubocop-airbnb support Sep 7, 2018
@wfleming wfleming changed the title Support rubocop-airbnb support Support rubocop-airbnb plugin Sep 7, 2018
@modosc
Copy link

modosc commented Oct 29, 2018

would a pr help on this?

@Manfred
Copy link

Manfred commented Jul 10, 2019

Lots of people will soon have the same problem with rubocop-rails.

@andyw8
Copy link
Contributor

andyw8 commented Jul 11, 2019

@Manfred rubocop-rails is already supported:

#178

ChristianRimondi added a commit to solidusio/solidus_graphql_api that referenced this issue Jan 17, 2020
As stated here[1], 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 our own third party plugins.

For this reasons, the RuboCop checks will be moved to the CI.

[1]
codeclimate/codeclimate-rubocop#131 (comment)
ChristianRimondi added a commit to solidusio/solidus_graphql_api that referenced this issue Jan 17, 2020
As stated here[1], 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 our own third party plugins.

For this reasons, the RuboCop checks will be moved to the CI.

[1] codeclimate/codeclimate-rubocop#131 (comment)
ChristianRimondi added a commit to solidusio/solidus_graphql_api that referenced this issue Jan 17, 2020
As stated here[1], 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 our own third party plugins.

For this reasons, the RuboCop checks will be moved to the CI.

[1] codeclimate/codeclimate-rubocop#131 (comment)
@andrewjking65
Copy link

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.

@bmulholland
Copy link

@filipesperandio would you accept a PR that adds rubocop-airbnb?

@filipesperandio
Copy link
Contributor

@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.

@bmulholland
Copy link

Just to cross-post, I submitted a PR to upgrade packages in rubocop-airbnb that may help this along: airbnb/ruby#178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants