Yamllint: Difference between revisions

Add VSCode settings section
link to github action workflow for yamllint in the Meza repo
 
Line 3: Line 3:
Use an online validator like https://www.yamllint.com/ or https://jsonformatter.org/yaml-validator  
Use an online validator like https://www.yamllint.com/ or https://jsonformatter.org/yaml-validator  


Of course, you should have one in your local tools and CI pipeline to ensure that your [[YAML]] is always correct. With <code>yamllint</code>, there is both a script and a Python module; meaning you can write your own linting tool in Python by invoking (importing) the yamllint module<ref>https://yamllint.readthedocs.io/en/stable/development.html</ref>. See the caveat section below about "using the right tool for the job" - meaning use the right linter for the language/project you are linting.
Of course, you should have one in your local tools and [https://github.com/freephile/meza/blob/e4ba295c4705ba982ae3b5c100ce212d366c1330/.github/workflows/yamllint.yml CI pipeline to ensure] that your [[YAML]] is always correct. With <code>yamllint</code>, there is both a script and a Python module; meaning you can write your own linting tool in Python by invoking (importing) the yamllint module<ref>https://yamllint.readthedocs.io/en/stable/development.html</ref>. See the caveat section below about "using the right tool for the job" - meaning use the right linter for the language/project you are linting.


{{Notice|If you have a <tt>.yamllint</tt> file in your working directory, it will be automatically loaded as configuration by yamllint.}}
{{Notice|If you have a <tt>.yamllint</tt> file in your working directory, it will be automatically loaded as configuration by yamllint.}}