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

Feature Request: Implement yamllint rules #240

Open roaldnefs opened 3 years ago

roaldnefs commented 3 years ago

Is your feature request related to a problem? Please describe. Allow running the same rules as yamllint on SLS files to check for issues such as indentation, etc.

Describe the solution you'd like Add rule to run yamllint on SLS files after stripping all Jinja expressions, statements and comments. See the YamlLintRule in ansible-lint as an example.

Describe alternatives you've considered Re-implementing all the yamllint rules separately.

Additional context This feature request duplicates #106, #105, #92.

colttt commented 3 years ago

any news on that? maybe you can add this to you salt-lint docker file to install?!

jbouter commented 3 years ago

Hi @colttt !

It's not as easy as simply adding yamllint. But for now we don't have a status update sadly.

Feel free to use our container image for salt-lint and add yamllint yourself though. Or implement a new step in your CI where you run yamllint on all sls files. Though be prepared for a whole lot of false positives.

colttt commented 3 years ago

Feel free to use our container image for salt-lint and add yamllint yourself though. I try that, but I can't install it, permission denied with the following config (as you remember, its my first time ;) )

default:
 before_script:
    - apk add yamllint

I got:

$ apk add yamllint
ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied
jbouter commented 3 years ago

It's a hardened image. You can't just add stuff to the container itself.

Fork the Dockerfile and build it yourself.

roaldnefs commented 1 year ago

Opened #297 to further discuss to possible solutions.

This issues related to #246 and #258.