sds / haml-lint

Tool for writing clean and consistent HAML
MIT License
318 stars 101 forks source link

Syntax linter ignores exclude #330

Closed wintersolutions closed 3 years ago

wintersolutions commented 3 years ago

I have a configuration file:

linters:
  Syntax:
    exclude:
      - lib/templates/haml/scaffold/_form.html.haml

When I run haml-lint with it, it still reports:

lib/templates/haml/scaffold/_form.html.haml:5 [E] Syntax: Illegal nesting: nesting within plain text is illegal.

As a workaround I would love to put the file in the global exclude but this is a inherited file and the parent declares a global exclude already.

sds commented 3 years ago

Hey @wintersolutions, you aren't able to disable the Syntax linter. It's a bit special in that it must pass in order for any other linters to be run against a file.

Hopefully this makes sense—if we aren't able to parse the HAML file to create a syntax tree, then none of the linters can work.

If you want to skip the file entirely, add it to your global exclude list (at the root of your .haml-lint.yml file) rather than using a linter option. See docs.

wintersolutions commented 3 years ago

Thank you for clearing up the Syntax linter behavior. Adding it to .haml-lint won't work in my case. I'll find another workaround.