1

The aim is to exclude a certain line that contains a checksum and cannot be smaller than 80 characters.

--> Scenario: 'default'
--> Action: 'lint'
--> Executing Yamllint on files found in /tmp/ansible-firefox/...
    /tmp/ansible-firefox/defaults/main.yml
      2:81      error    line too long (153 > 80 characters)  (line-length)

defaults/main.yml

firefox_checksum: sha512:49d776cfb5f42c6e5ea1a55a80d9f6bad223080b16baa0d39de63534c25e68340091b4e16be5355d565f81291cb94fb996f03ae7e3e4c7a28021b0a0929daf58
3

According to the yamllint documentation you need to add a special comment to the line -- <string-to-be-excluded> # yamllint disable-line rule:line-length

---
#defaults/main
firefox_checksum: sha512:49d776cfb5f42c6e5ea1a55a80d9f6bad223080b16baa0d39de63534c25e68340091b4e16be5355d565f81291cb94fb996f03ae7e3e4c7a28021b0a0929daf58 #yamllint disable-line rule:line-length
1
  • 1
    Note that there should be two spaces after the the string to be excluded and that a space should reside in front of the yamllint in order to exclude yaml lint length testing for a certain line number (see this) – 030 Nov 12 '18 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.