yamllint
yamllint copied to clipboard
Rule 'comments' should ignore Cloud-Init "#cloud-config" similar to shebangs
I noticed that shebangs can be configured to be ignored in recent versions. Cloud-Init has a similar string at the start of a document which should be also ignored: #cloud-config
https://cloudinit.readthedocs.io/en/latest/topics/examples.html?highlight=%23cloud-config
It makes sense. However there will probably be other magic values #foo
in the future. Maybe the best would be to specify the list of regex to ignore?
rules:
comments:
require-starting-space: true
ignore-regex:
- ^#!
- ^#cloud-config
min-spaces-from-content: 2
That would be even better, yes.
It looks like another user would like the same thing: https://github.com/adrienverge/yamllint/issues/416.
Contributions are welcome!
Another example of this would be sops encrypted comments which look like:
#ENC[AES256_GCM,data:XXXXXXXXXXXXXXX,iv:YYYYYYYYYYYYYYYY,tag:ZZZZZZZZZZZZZZ,type:comment]
Closing in favor of https://github.com/adrienverge/yamllint/issues/545.