You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
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 thatlinter
spawns hascwd
set to~/my_project/foo
, which is fine for picking up the correcthaml-lint.yml
file without any intervention becausehaml-lint
uses ruby'sDir.pwd
as a starting point to locatehaml-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 afindFile
call looking for.rubocop.yml
starting withcwd
. Theoretically we could do the same, buthaml-lint
does not currently support specifying the location of the rubocop config, only the location of the haml-lint config.The text was updated successfully, but these errors were encountered: