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
My project has a .slim-lint.yml in the root of the project containing the following:
exclude:
- 'lib/templates/slim/**/*'
When run via overcommit, the exclusion is not honored:
$ overcommit -r
Analyze with slim-lint.....................................[SlimLint] FAILED
Unexpected output: unable to determine line number or type of error/warning for output:
(Using Ruby 2.4 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)
/Users/mbrictson/Code/my-rails-app/lib/templates/slim/scaffold/_form.html.slim:6 [W] RuboCop: Lint/Syntax: unexpected token tIDENTIFIER
From what I can tell, this is because overcommit calls the slim-lint command with a list of absolute paths. These absolute paths don't match when compared to the relative exclude pattern.
My current workaround is to prepend a glob wildcard like this:
exclude:
# Leading "**" is needed for compatibility with overcommit
- '**/lib/templates/slim/**/*'
However I think a better solution would be for slim-lint to resolve relative paths as relative to the location of the .slim-lint.yml file. This would be consistent with RuboCop's behavior: rubocop/rubocop#892
The text was updated successfully, but these errors were encountered:
My project has a
.slim-lint.yml
in the root of the project containing the following:When run via overcommit, the exclusion is not honored:
From what I can tell, this is because overcommit calls the slim-lint command with a list of absolute paths. These absolute paths don't match when compared to the relative
exclude
pattern.My current workaround is to prepend a glob wildcard like this:
However I think a better solution would be for slim-lint to resolve relative paths as relative to the location of the
.slim-lint.yml
file. This would be consistent with RuboCop's behavior: rubocop/rubocop#892The text was updated successfully, but these errors were encountered: