1.目的
yamllint で以下のworningのみを抑止する
・line too long (82 > 80 characters) (line-length)
・comment
・trailing spaces
2. yamllint version
# yamllint -v yamllint 1.26.0
3.Default configuration
yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'
rules:
braces: enable
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start:
level: warning
empty-lines: enable
empty-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length: enable
new-line-at-end-of-file: enable
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy:
level: warning
4.configuration file の作成
# vi .yamllint
5.line too long (82 > 80 characters) (line-length)とcommentを抑止
80行から120行に変更
・before
comments:
level: warning
line-length: enable
trailing-spaces: enable
・after
comments: enable
line-length:
max: 120
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: false
trailing-spaces: disable
5.configuration file の作成後
# cat .yamllint
---
yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'
rules:
braces: enable
brackets: enable
colons: enable
commas: enable
comments: enable
comments-indentation:
level: warning
document-end: disable
document-start:
level: warning
empty-lines: enable
empty-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length:
max: 120
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: false
new-line-at-end-of-file: enable
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: disable
truthy:
level: warning