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

Respect inherit_gem directive #142

Open
swiknaba opened this issue Jan 11, 2021 · 4 comments
Open

Respect inherit_gem directive #142

swiknaba opened this issue Jan 11, 2021 · 4 comments

Comments

@swiknaba
Copy link

swiknaba commented Jan 11, 2021

I started investigating an issue, and though it was related to #62 (comment), however, I believe "my" problem is a different one.

Assume a .rubocop.yml file as follows:

# .rubocop.yml

inherit_gem:
  rubocop-rails_config:
    - config/rails.yml

(taken from https://github.com/toshimaru/rubocop-rails_config/#usage)

then this VSCode extension does not correctly inherit the settings from the rubocop-rails_config gem.

Docs for the inherit_gem directive: https://docs.rubocop.org/rubocop/configuration.html#inheriting-configuration-from-a-dependency-gem

How to test

Write code that follows the style of the said gem, but violates Rubocop default settings. Then bundle exec rubocop will succeed, but running rubocop:lint using this VSCode extension will fail.
Setting the rubocop config path in VSCode to ~/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/rubocop-rails_config-xxx/config/rails.yml solves the problem, but is not desired, since it should support different settings for each repo, i.e. just leaving the field blank should resolve the local .rubocop.yml file correctly.

@flobarrios
Copy link

Hi @swiknaba, did you find a solution? we are having as similar problem :(

@swiknaba
Copy link
Author

Hi @swiknaba, did you find a solution? we are having as similar problem :(

sadly, I have no solution. Currently, I just enforce the rubocop config path in VSCode, and I've put that in a .vscode/settings.jon file in each repo, so that I don't have to change VSCode settings when I switch codebase.

@ibtehajnasar
Copy link

ibtehajnasar commented Jun 27, 2022

I resolve the same issue by upgrading my rubocop-shopify gem to the latest version 2.7.0 faced an issue with 2.6.0
The issue is the same you can try the latest version of rubocop-rails_config
I had this setting in my rubocop.yml

inherit_gem: rubocop-shopify: rubocop.yml

@Yousaf1290
Copy link

I resolve the same issue by upgrading my rubocop-shopify gem to the latest version 2.7.0 faced issue with 2.6.0 I had this setting in my rubocop.yml

inherit_gem: rubocop-shopify: rubocop.yml

Thanks really helpful.

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

No branches or pull requests

4 participants