warpnet / salt-lint

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

Require spaces around parenthesis in top file #276

Open clickthisnick opened 2 years ago

clickthisnick commented 2 years ago

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

We have noticed that compound matching does not work in the top.sls file if you don't have spaces around the parenthesis

  'G@apple:yum and G@spinach:yum and (G@name:foo or G@name:bar or G@name:baz)':
    - foo.bar

The above did not work, whereas below with spaces ( and ) worked.

  'G@apple:yum and G@spinach:yum and ( G@name:foo or G@name:bar or G@name:baz )':
    - foo.bar

Describe the solution you'd like

It would be nice if salt-lint gave a warning to include spaces here

Describe alternatives you've considered

Haven't thought about anything else 😉

Additional context

None

roaldnefs commented 2 years ago

Thanks @clickthisnick for the feature request!

According to the SaltStack documentation the compound matchers indeed requires spaces between the parentheses and targets:

Be certain to note that spaces are required between the parentheses and targets. Failing to obey this rule may result in incorrect targeting!