Skip to content

Warn .rubocop.yml file does not exist. Ignoring... #62

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

Open
micahlisonbee opened this issue Dec 22, 2017 · 13 comments
Open

Warn .rubocop.yml file does not exist. Ignoring... #62

micahlisonbee opened this issue Dec 22, 2017 · 13 comments

Comments

@micahlisonbee
Copy link

Just upgraded to VS Code 1.19.1 today and the .rubocop.yml can't be found. It's in my project root. I'm on macOS 10.12.6.

This warning appears on every file load:
.rubocop.yml file does not exist. Ignoring...

My path setting is:
"ruby.rubocop.configFilePath": ".rubocop.yml",

I've also tried the full local path, no luck:
"ruby.rubocop.configFilePath": "/Users/micliz/code/ravn/clients/beynd/beynd-api/.rubocop.yml"

@micahlisonbee
Copy link
Author

Update: Setting the full path now works, but the relative path "ruby.rubocop.configFilePath": ".rubocop.yml", still does not work. Still on 1.19.1.

@psukys
Copy link

psukys commented Jan 29, 2018

Can confirm that it as well does not work with vscode variable is set up: {workspaceRoot}

@cannyedge34
Copy link

Same problem!

@drewrodrigues
Copy link

Same problem..

@Kotwic4
Copy link

Kotwic4 commented May 8, 2018

Same problem

@hafrei
Copy link

hafrei commented Jun 27, 2018

Same problem, but on Windows 10

@MartinSGill
Copy link

Same problem.

Can confirm that it as well does not work with vscode variable is set up: {workspaceRoot}

Variables are not supported in Settings Files.
https://code.visualstudio.com/docs/editor/variables-reference#_is-variable-substitution-supported-in-user-and-workspace-settings

@rodrigobdz
Copy link

Adding "Same problem" does not help solving the issue. Please consider using reactions instead.

@jlurena
Copy link

jlurena commented Jan 14, 2019

Is this issue being looked at?

@rodriguekayembe
Copy link

Can we confirm that this has not been resolved?

@estani
Copy link

estani commented Jun 5, 2019

Added a fix, waiting for acceptance - #100

If you can't wait, here's the patch
rubocop.js.patch.txt

just apply it to the rubocop extension (e.g. ~/.vscode/extensions/misogi.ruby-rubocop-0.8.0/out/src/rubocop.js)

If the file was there you could do something like:
patch ~/.vscode/extensions/misogi.ruby-rubocop-0.8.0/out/src/rubocop.js rubocop.js.patch.txt

@swiknaba
Copy link

swiknaba commented Jan 11, 2021

@estani this fix now shows me a warning, that the rubcoop.yml from the relative path to my project is not found, and VSCode will use .rubcop.yml --also I am not sure, which file exactly is meant.

Found multiple files (.rubocop.yml, ~/Sites/foo/bar/.rubocop.yml) will use .rubocop.yml)

-> I am currently working on project /foo/bar; having different rubocop configs for different projects. Passing in the ABS path works, however, I do not want to change the abs path in the settings whenever I switch to another repo. (besides, I still get a different behavior even when setting the abs path -.-).

When running bundle exec rubocop, no offenses are shown, however, inside VSCode, I get a lot of linting errors.
My rubocpp.yml file inherits the settings from another rubocop-gem. These are my VSCode settings now:

{
    "ruby.rubocop.executePath": "~/.rbenv/shims/",
    "ruby.rubocop.useBundler": true,
}

local rubocop config:

# .rubocop.yml

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

-> using this gem: https://github.com/toshimaru/rubocop-rails_config/#usage

update:
the only way it works, is to set the rubocop config file path to

~/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/rubocop-rails_config-xxx/config/rails.yml

which I also don't want to set globally, not every project is using this. From this, I believe this VSCode extension cannot handle the inherit_gem directive. ==> added a new issue: #142

@TSMMark
Copy link

TSMMark commented Dec 8, 2022

The Found multiple files warning popup comes up all the time and I can't get it to stop unless I remove ruby.rubocop.configFilePath from workspace settings, which I can't do.

It's literally talking about the same file. Just one is relative and not expanded for some reason:

Screen Shot 2022-12-08 at 11 08 35 AM

Couldn't this be solved by expanding the relative path to an absolute path, and dedupe before comparing and deciding if "Found multiple files"?

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