summaryrefslogtreecommitdiff
path: root/doc/ale-yaml.txt
blob: b3450b876668d6c434a264aa8dcabf0fcc94306b (plain)
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
===============================================================================
ALE YAML Integration                                         *ale-yaml-options*


===============================================================================
actionlint                                                *ale-yaml-actionlint*

Website: https://github.com/rhysd/actionlint


Installation
-------------------------------------------------------------------------------

See installation guide: https://github.com/rhysd/actionlint#quick-start

This linter is disabled by default and must be enabled by setting `g:ale_linters`.
To enable it only for Github Action YAML files a configuration like this is
better:

>
 au BufRead,BufNewFile */.github/*/*.y{,a}ml
                                \ let b:ale_linters = {'yaml': ['actionlint']}
<

Options
-------------------------------------------------------------------------------

g:ale_yaml_actionlint_executable             *g:ale_yaml_actionlint_executable*
                                             *b:ale_yaml_actionlint_executable*
  Type: |String|
  Default: `'actionlint'`

  This variable can be set to change the path to actionlint.

g:ale_yaml_actionlint_options                   *g:ale_yaml_actionlint_options*
                                                *b:ale_yaml_actionlint_options*

  Type: |String|
  Default: `''`

  This variable can be set to add extra options to actionlint executable.

  For example, to disable running `shellcheck` and `pyflakes` external commands,
  you may want to set:
>
  let g:ale_yaml_actionlint_options = '-shellcheck= -pyflakes='
<
  Please note that passing `-format` as option is not supported at the moment.

===============================================================================
circleci                                                    *ale-yaml-circleci*

Website: https://circleci.com/docs/2.0/local-cli


Installation
-------------------------------------------------------------------------------

Follow the instructions on the website, and make sure to test that you can
validate configuration files with: >

  circleci config validate - < .circleci/config.yml
<

As long as the validator runs correctly, you should be able to see errors when
you save the configuration file. The validator doesn't run as you type because
it sends network requests, and running too often would overload the circleci
servers.


===============================================================================
prettier                                                    *ale-yaml-prettier*

Website: https://github.com/prettier/prettier


Installation
-------------------------------------------------------------------------------

Install prettier either globally or locally: >

  npm install prettier -g  # global
  npm install prettier     # local
<

===============================================================================
spectral                                                    *ale-yaml-spectral*

Website: https://github.com/stoplightio/spectral


Installation
-------------------------------------------------------------------------------

Install spectral either globally or locally: >

  npm install @stoplight/spectral -g  # global
  npm install @stoplight/spectral     # local
<

Options
-------------------------------------------------------------------------------

g:ale_yaml_spectral_executable                 *g:ale_yaml_spectral_executable*
                                               *b:ale_yaml_spectral_executable*
  Type: |String|
  Default: `'spectral'`

  This variable can be set to change the path to spectral.

g:ale_yaml_spectral_use_global                 *g:ale_yaml_spectral_use_global*
                                               *b:ale_yaml_spectral_use_global*
  Type: |String|
  Default: `get(g:, 'ale_use_global_executables', 0)`

  See |ale-integrations-local-executables|


===============================================================================
swaglint                                                    *ale-yaml-swaglint*

Website: https://github.com/byCedric/swaglint


Installation
-------------------------------------------------------------------------------

Install swaglint either globally or locally: >

  npm install swaglint -g  # global
  npm install swaglint     # local
<

Options
-------------------------------------------------------------------------------

g:ale_yaml_swaglint_executable                 *g:ale_yaml_swaglint_executable*
                                               *b:ale_yaml_swaglint_executable*
  Type: |String|
  Default: `'swaglint'`

  This variable can be set to change the path to swaglint.


g:ale_yaml_swaglint_use_global                 *g:ale_yaml_swaglint_use_global*
                                               *b:ale_yaml_swaglint_use_global*
  Type: |String|
  Default: `get(g:, 'ale_use_global_executables', 0)`

  See |ale-integrations-local-executables|


===============================================================================
yaml-language-server                                 *ale-yaml-language-server*

Website: https://github.com/redhat-developer/yaml-language-server


Installation
-------------------------------------------------------------------------------

Install yaml-language-server either globally or locally: >

  npm install yaml-language-server -g  # global
  npm install yaml-language-server     # local


Options
-------------------------------------------------------------------------------

g:ale_yaml_ls_executable                             *g:ale_yaml_ls_executable*
                                                     *b:ale_yaml_ls_executable*
  Type: |String|
  Default: `'yaml-language-server'`

  This variable can be set to change the path to yaml-language-server.


g:ale_yaml_ls_config                                     *g:ale_yaml_ls_config*
                                                         *b:ale_yaml_ls_config*
  Type: |Dictionary|
  Default: `{}`

  Dictionary containing configuration settings that will be passed to the
  language server.  For example, to enable schema store: >
      {
    \   'yaml': {
    \     'schemaStore': {
    \         'enable': v:true,
    \     },
    \   },
    \ }
<
  Consult the yaml-language-server documentation for more information about
  settings.


g:ale_yaml_ls_use_global                             *g:ale_yaml_ls_use_global*
                                                     *b:ale_yaml_ls_use_global*
  Type: |String|
  Default: `get(g:, 'ale_use_global_executables', 0)`

  See |ale-integrations-local-executables|


===============================================================================
yamlfix                                                      *ale-yaml-yamlfix*

Website: https://lyz-code.github.io/yamlfix


Installation
-------------------------------------------------------------------------------

Install yamlfix: >

  pip install yamlfix
<

Options
-------------------------------------------------------------------------------
g:ale_yaml_yamlfix_executable                   *g:ale_yaml_yamlfix_executable*
                                                *b:ale_yaml_yamlfix_executable*
  Type: |String|
  Default: `'yamlfix'`

  See |ale-integrations-local-executables|


g:ale_yaml_yamlfix_options                         *g:ale_yaml_yamlfix_options*
                                                   *b:ale_yaml_yamlfix_options*
  Type: |String|
  Default: `''`

  This variable can be set to pass extra options to yamlfix.

g:ale_yaml_yamlfix_use_global                   *g:ale_yaml_yamlfix_use_global*
                                                *b:ale_yaml_yamlfix_use_global*
  Type: |Number|
  Default: `get(g:, 'ale_use_global_executables', 0)`

  See |ale-integrations-local-executables|


===============================================================================
yamllint                                                    *ale-yaml-yamllint*

Website: https://github.com/adrienverge/yamllint


Installation
-------------------------------------------------------------------------------

Install yamllint in your a virtualenv directory, locally, or globally: >

  pip install yamllint # After activating virtualenv
  pip install --user yamllint # Install to ~/.local/bin
  sudo pip install yamllint # Install globally

See |g:ale_virtualenv_dir_names| for configuring how ALE searches for
virtualenv directories.


Options
-------------------------------------------------------------------------------

g:ale_yaml_yamllint_executable                 *g:ale_yaml_yamllint_executable*
                                               *b:ale_yaml_yamllint_executable*
  Type: |String|
  Default: `'yamllint'`

  This variable can be set to change the path to yamllint.


g:ale_yaml_yamllint_options                       *g:ale_yaml_yamllint_options*
                                                  *b:ale_yaml_yamllint_options*
  Type: |String|
  Default: `''`

  This variable can be set to pass additional options to yamllint.


===============================================================================
gitlablint                                                  *ale-yaml-gitlablint*

Website: https://github.com/elijah-roberts/gitlab-lint


Installation
-------------------------------------------------------------------------------

Install yamllint in your a virtualenv directory, locally, or globally: >

  pip3 install gitlab_lint        # After activating virtualenv
  pip3 install --user gitlab_lint # Install to ~/.local/bin
  sudo pip3 install gitlab_lint   # Install globally

See |g:ale_virtualenv_dir_names| for configuring how ALE searches for
virtualenv directories.

Is recommended to use |g:ale_pattern_options| to enable this linter so it only
applies to 'gitlab-ci.yml' files and not all yaml files:
>
  let g:ale_pattern_options = {
  \   '.gitlab-ci\.yml$': {
  \       'ale_linters': ['gitlablint'],
  \   },
  \}
<

Options
-------------------------------------------------------------------------------

g:ale_yaml_gitlablint_executable               *g:ale_yaml_gitlablint_executable*
                                               *b:ale_yaml_gitlablint_executable*
  Type: |String|
  Default: `'gll'`

  This variable can be set to change the path to gll.


g:ale_yaml_gitlablint_options                     *g:ale_yaml_gitlablint_options*
                                                  *b:ale_yaml_gitlablint_options*
  Type: |String|
  Default: `''`

  This variable can be set to pass additional options to gll.


===============================================================================
  vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: