Answers: <p>My bad, I was searching using the wrong keyword, I just found out that ignoring a file or dir is quite easy, you just need to add an gitignore style block to your yamllint config file, as :</p>
  
  <pre><code>ignore: |
    *globalParamName.sls
    *platform.sls
  </code></pre>
  
  <p>See the official doc <a href="https://yamllint.readthedocs.io/en/stable/configuration.html#ignoring-paths" rel="nofollow noreferrer">here</a>.</p>
  
Answers: CC BY-SA 3.0
Answers: 2018-04-01T11:39:57.080Z
Answers: 2018-04-01T11:39:57.080Z
Answers: Pier
Answers: <p>I just run the code, e.g. Ansible or kubectl and if the yaml is incorrect these tools point out the line that contains the error. I never use a separate tool for validation the yaml.</p>
  
Answers: CC BY-SA 3.0
Answers: 2018-05-01T22:09:08.137Z
Answers: 2018-05-01T22:09:08.137Z
Answers: 030
Answers: <p>There is a new tool available with Salt 3005 - <a href="https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.yaml.html" rel="nofollow noreferrer"><code>yaml.lint</code></a></p>
  <pre class="lang-sh prettyprint-override"><code>salt-call yaml.lint salt://example/bad_yaml.sls
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2022-09-12T20:48:52.503Z
Answers: 2022-09-12T20:48:52.503Z
Answers: OrangeDog
Answers: <p>One tool I have used in the past is <a href="https://cryptic-cliffs-32040.herokuapp.com/" rel="nofollow noreferrer">this</a> which does a great job of rendering YAML/JSON and allows you to inspect the resulting output in order to validate.</p>
  
Answers: CC BY-SA 3.0
Answers: 2018-05-01T21:28:16.247Z
Answers: 2018-05-01T21:28:16.247Z
Answers: James Shewey
Body: <p>I am using <a href="https://yamllint.readthedocs.io/en/stable/index.html" rel="noreferrer">https://yamllint.readthedocs.io/en/stable/index.html</a> to lint my yaml files (used in a saltstack context, and linted by jenkins jobs at every commit), but as reported and explained <a href="https://github.com/adrienverge/yamllint/issues/61" rel="noreferrer">here</a>, it is not possible to validate a yaml file in which is used jinja code.</p>
  
  <p>How do you guys validate / lint your yaml files ?</p>
  
  <p>Do you see a way to keep using yamllint without failing due to jinja code ?</p>
  
  <p>Yaml structure error are the most occuring errors in my company, people from very different background come to edit pillar, that's why I really need a yaml validating process.</p>
  
Tags: <salt><jinja><yaml>
Title: Yaml linting failling when jinja is used
UserDisplayName: Pier
ThreadText: # Yaml linting failling when jinja is used
  
  (Asked by: username_0 on 2018-04-01)
  
  I am using <https://yamllint.readthedocs.io/en/stable/index.html> to lint my yaml files (used in a saltstack context, and linted by jenkins jobs at every commit), but as reported and explained [here](https://github.com/adrienverge/yamllint/issues/61), it is not possible to validate a yaml file in which is used jinja code.
  
  How do you guys validate / lint your yaml files ?
  
  Do you see a way to keep using yamllint without failing due to jinja code ?
  
  Yaml structure error are the most occuring errors in my company, people from very different background come to edit pillar, that's why I really need a yaml validating process.
  
  **Tags:** salt, jinja, yaml
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_0 on 2018-04-01. Score: 0 | Accepted answer
  
  My bad, I was searching using the wrong keyword, I just found out that ignoring a file or dir is quite easy, you just need to add an gitignore style block to your yamllint config file, as :
  
  ```
  ignore: |
    *globalParamName.sls
    *platform.sls
  
  ```
  
  See the official doc [here](https://yamllint.readthedocs.io/en/stable/configuration.html#ignoring-paths).
  
  
  ---
  
  ### Answer by username_1 on 2018-05-01. Score: 0
  
  I just run the code, e.g. Ansible or kubectl and if the yaml is incorrect these tools point out the line that contains the error. I never use a separate tool for validation the yaml.
  
  
  ---
  
  ### Answer by username_2 on 2022-09-12. Score: 0
  
  There is a new tool available with Salt 3005 - [`yaml.lint`](https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.yaml.html)
  
  ```sh
  salt-call yaml.lint salt://example/bad_yaml.sls
  
  ```
  
  
  ---
  
  ### Answer by username_3 on 2018-05-01. Score: 0
  
  One tool I have used in the past is [this](https://cryptic-cliffs-32040.herokuapp.com/) which does a great job of rendering YAML/JSON and allows you to inspect the resulting output in order to validate.
  
  
  ---
  
  