salt-lint icon indicating copy to clipboard operation
salt-lint copied to clipboard

Feature Request: Implement yamllint rules

Open roaldnefs opened this issue 3 years ago • 5 comments

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.

roaldnefs avatar Jan 29 '21 21:01 roaldnefs

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

colttt avatar Aug 16 '21 13:08 colttt

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.

jbouter avatar Aug 16 '21 14:08 jbouter

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

colttt avatar Aug 16 '21 14:08 colttt

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

Fork the Dockerfile and build it yourself.

jbouter avatar Aug 16 '21 14:08 jbouter

Opened #297 to further discuss to possible solutions.

This issues related to #246 and #258.

roaldnefs avatar Jan 13 '23 14:01 roaldnefs