Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Rubocop config is ignored #2

Closed
jschroeder9000 opened this issue Feb 24, 2015 · 0 comments
Closed

Rubocop config is ignored #2

jschroeder9000 opened this issue Feb 24, 2015 · 0 comments

Comments

@jschroeder9000
Copy link
Member

Currently we have a problem with rubocop config being ignored.

Say I have a file I am editing/linting located at ~/my_project/foo/bar.html.haml.

Then, before linting begins, a temporary file is written out to /tmp/hash_dir/bar.html.haml. The process that linter spawns has cwd set to ~/my_project/foo, which is fine for picking up the correct haml-lint.yml file without any intervention because haml-lint uses ruby's Dir.pwd as a starting point to locate haml-lint.yml.

However, rubocop starts looking for .rubocop.yml at the file's location (in this exemple, /tmp/hash_dir/bar.html.haml. This is a problem because most likely the correct location for .rubocop.yml is ~/my_project/.rubocop.yml, although because of rubocop's config inheritance abilities, it's possible that ~/my_project/foo/.rubocop.yml should be the config file loaded.

The linter-rubocop package solves this with a findFile call looking for .rubocop.yml starting with cwd. Theoretically we could do the same, but haml-lint does not currently support specifying the location of the rubocop config, only the location of the haml-lint config.

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

No branches or pull requests

1 participant