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 a check to defaults option in state if it exists #258

Closed vskubriev closed 1 year ago

vskubriev commented 3 years ago

Is your feature request related to a problem? Please describe.

I'm always frustrated when case like this appears:

  file.managed:
    - source: {{ source_prefix }}/conf/named.conf.local
    - template: jinja
    - defaults:
      config: {{ config }}
      hostname: {{ srv }}
      cfg: {{ cfg }}
      prefix: {{ prefix }}

Options in - defaults array should be indented. Otherwise there is no default options in template and it is frustrating me.

Describe the solution you'd like To be honest: I didn't know how to implement this case of check.

Describe alternatives you've considered Manually check the code base.

jbouter commented 1 year ago

This is a duplicate of #246 and will therefore be tracked in there