warpnet / salt-lint

A command-line utility that checks for best practices in SaltStack.
https://salt-lint.readthedocs.io/en/latest/
MIT License
154 stars 39 forks source link

Add option to disable the rule with comment #285

Closed vveliev-tc closed 11 months ago

vveliev-tc commented 2 years ago

Is your feature request related to a problem? Please describe. Yes, when yousing salt lint, I'm not able to diable specific rule in a single file

Describe the solution you'd like

Similar to other lints I would like to have option to disable rule per line and per file

  #salt-lint disable rule: 213, 204
  cmd.wait:
    - cwd: /usr/local

Describe alternatives you've considered

disabling rule for the project

Additional context

similar options available in other lints https://yamllint.readthedocs.io/en/stable/disable_with_comments.html

brokoli18 commented 1 year ago

It seems you can already do this: https://salt-lint.readthedocs.io/en/latest/rules/

Example:

 - source: salt://{{unspaced_var}}/example  # noqa: 206
roaldnefs commented 11 months ago

You can already ignore a specific rule by adding # noqa [rule_id] at the end of the line as explained by @brokoli18.