-
Notifications
You must be signed in to change notification settings - Fork 16
/
yamllint.cli.txt
162 lines (143 loc) · 10.7 KB
/
yamllint.cli.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
YAMLLINT
VERSION ==> #1.32.0
#Goal:
# - YAML formatting rules linting
# - also include check for duplicate keys, and no ---/... enforcement
# - for YAML syntax validation, should try loading with a parser instead
CONFIGURATION ==> #Can be:
# - ENVVAR YAMLLINT_CONFIG_FILE
# - --config-file CONF_FILE
# - --config-data CONF_NAME|"YAML"
# - [...]/.yamllint[.y[a]ml]
# - ~/.config/yamllint/config
#CONF is YAML file:
# - extends CONF_NAME
# - rules.RULE VAL:
# - "disable|enable"
# - RULE_OPTS (implies "enable"):
# - level "warning" or "error" (def)
# - any rule-dependent options
#CONF_NAME:
# - "default": the default values documented here
# - "relaxed": see online doc
CONF[.rules.RULE].ignore #Newline-separated 'GLOB'... with similar syntax as .gitignore
CONF.ignore-from-file #Same but PATH to file like .gitignore
CONF.yaml-files #'GLOB'_ARR of whitelisted files (def: ['*.yaml', '*.yml'])
--list-files #Print list of files
yamllint YAMLFILE|DIR... #DIR is DIR/**/*.y[a]ml
#Prints on linting problems
#YAMLFILE can be '-' (stdin)
--format STR #Output format between:
# - auto (def): colored or standard
# - colored: human-friendly colored
# - standard: human-friendly non-colored
# - parsable: FILE:LINE:COL: [error|warning] MESSAGE (RULE)
# - github (def when ENVVAR GITHUB_ACTIONS|GITHUB_WORKFLOW):
# - GitHub annotation
# - ::[error|warning] file=FILE,line=LINE,col=COL::[RULE] MESSAGE
--strict #Exit code is:
# (not --strict)
# - on success|warnings: 0
# - on errors: 1
# (--strict)
# - on success: 0
# - on errors: 1
# - on warnings: 2
--no-warnings #Ignore warnings
CONF.locale #'LANG' (def: 'C.UTF-8')
#Used by key-ordering rule
# yamllint disable-file #Disable yamllint on whole file
# yamllint disable-line
[rule:RULE ...] #Disable yamllint on next line (if full-line comment) or current line (if end-of-line)
# yamllint disable|enable
[rule:RULE ...] #Same for parts of file
/=+===============================+=\
/ : : \
)==: RULES :==(
\ :_______________________________: /
\=+===============================+=/
braces #Spaces after { or before }
#OPTS:
# - min|max-spaces-inside[-empty] NUM (-1 to disable) (def: 0 for non-empty, -1 for empty)
# - forbid: no flow mappings
# - BOOL (def: false)
# - 'non-empty': except for empty OBJ
#'empty' for is for empty {}
brackets #Same for [], same OPTS
hyphens #Spaces after -
#OPTS.max-spaces-after NUM (def: 1)
colons #Spaces around :
#OPTS.max-spaces-before|after NUM (-1 to disable) (def: 0|1)
commas #Spaces around ,
#OPTS.min|max-spaces-before|after NUM (-1 to disable, for max) (def: 0 before, 1 after)
comments #Spaces in comments
#OPTS:
# - require-starting-space BOOL (def: true): space after #
# - ignore-shabang BOOL (def: true): exception for require-starting-space for shabangs
# - min-spaces-from-content NUM (def: 2): spaces before #, if end-of-line comment
#Def: warning
trailing-spaces #No trailing spaces at end of line
#Def: enable
indentation #OPTS:
# - spaces NUM or "consistent" (def): indentation width
# - check-multi-line-strings BOOL (def: false): whether to also lint multiline STR indent
# - indent-sequences VAL:
# - ARR inside OBJ indentation, since it is optional
# - can be:
# - BOOL (def: true): always|never
# - "consistent": any, as long as consistent
# - "whatever": any
comments-indentation #Comments must be indented like code
#Def: warning
empty-lines #Max number of consecutive blank lines
#OPTS:
# - max NUM (def: 2)
# - max-start|end NUM (def: 0): same at start|end of file
new-line-at-end-of-file #\n at end of file
#Def: enable
new-lines #Among OPTS.type 'unix' (LF) (def) or 'dos' (CRLF) or 'platform' (guessed)
line-length #Line width
#OPTS:
# - max NUM (def: 80)
# - allow-non-breakable-words BOOL (def: true): do not enforce rule for long words
# - allow-non-breakable-inline-mappings BOOL (def: false):
# do not enforce rule for long words, including in OBJ
document-start|end #Requires|forbids --- or ...
#OPTS.present BOOL
#Def: forbids ..., warns on no ---
quoted-strings #Forces quoting on any STR
#OPTS:
# - quote-type 'single', 'double' or 'any' (def)
# - required true (def), false or 'only-when-needed'
# - extra-required 'REGEXP'_ARR: force quoting if match those. OPTS.required must not be true
# - extra-allowed 'REGEXP'_ARR: allow no quoting if match those.
# - allow-quoted-quotes BOOL (def: false): allows forbidden quoted if quoted themselves
truthy #Forces quoting or !!str for yes|no|on|off|y|n or non-lowercase TRUE|FALSE
#Def: warning
#OPTS:
# - allowed-values ARR (def: ['true', 'false'])
# - check-keys BOOL (def: true): checks OBJ keys
empty-values #Prevents empty values (i.e. implicit null)
#OPTS:
# - forbid-in-block-mappings BOOL (def: false): in "block style"
# - forbid-in-flow-mappings BOOL (def: false): in "flow style"
#Def: disable
octal-values #Prevents OPTS:
# - forbid-implicit-octal BOOL (def: false): 0...
# - forbid-explicit-octal BOOL (def: false): 0o...
#Def: disable
float-values #Prevent OPTS:
# - forbid-inf (def: false): Infinity
# - forbid-nan (def: false): NaN
# - forbid-scientific-notation (def: false): ...e...
# - require-numeral-before-decimal (def: false): .NUM instead of 0.NUM
key-duplicates #Prevents duplicated keys
#Def: enable
key-ordering #Forces sorting (Unicode point-wise) of OBJ keys
#Def: disable
anchors #Disable invalid &REF
OPTS.forbid-duplicated-anchors #BOOL (def: false). Avoid twice same &REF
OPTS.forbid-unused-anchors #BOOL (def: false). Avoid &REF without a corresponding *REF
OPTS.forbid-undeclared-aliases #BOOL (def: true). Avoid *REF without a corresponding &REF