Implement Lua ALE setup & overhaul documentation

1. Add ale.setup and ale.setup.buffer for pure Lua configuration.
2. Update many global settings to use Booleans instead of numbers to
   make types easiert to work with in Lua.
3. Radically reformat documentation and fix errors to make
   documentation more usable for Neovim users.
This commit is contained in:
w0rp
2025-03-20 21:33:12 +00:00
parent 53f036fe9f
commit bcd1a12949
146 changed files with 5469 additions and 2642 deletions
+126 -60
View File
@@ -22,19 +22,23 @@ better:
\ let b:ale_linters = {'yaml': ['actionlint']}
<
Options
-------------------------------------------------------------------------------
g:ale_yaml_actionlint_executable *g:ale_yaml_actionlint_executable*
Options
*ale-options.yaml_actionlint_executable*
*g:ale_yaml_actionlint_executable*
*b:ale_yaml_actionlint_executable*
yaml_actionlint_executable
g: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*
*ale-options.yaml_actionlint_options*
*g:ale_yaml_actionlint_options*
*b:ale_yaml_actionlint_options*
yaml_actionlint_options
g:ale_yaml_actionlint_options
Type: |String|
Default: `''`
@@ -99,18 +103,23 @@ Install spectral either globally or locally: >
npm install @stoplight/spectral # local
<
Options
-------------------------------------------------------------------------------
g:ale_yaml_spectral_executable *g:ale_yaml_spectral_executable*
Options
*ale-options.yaml_spectral_executable*
*g:ale_yaml_spectral_executable*
*b:ale_yaml_spectral_executable*
yaml_spectral_executable
g: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*
*ale-options.yaml_spectral_use_global*
*g:ale_yaml_spectral_use_global*
*b:ale_yaml_spectral_use_global*
yaml_spectral_use_global
g:ale_yaml_spectral_use_global
Type: |String|
Default: `get(g:, 'ale_use_global_executables', 0)`
@@ -132,19 +141,23 @@ Install swaglint either globally or locally: >
npm install swaglint # local
<
Options
-------------------------------------------------------------------------------
g:ale_yaml_swaglint_executable *g:ale_yaml_swaglint_executable*
Options
*ale-options.yaml_swaglint_executable*
*g:ale_yaml_swaglint_executable*
*b:ale_yaml_swaglint_executable*
yaml_swaglint_executable
g: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*
*ale-options.yaml_swaglint_use_global*
*g:ale_yaml_swaglint_use_global*
*b:ale_yaml_swaglint_use_global*
yaml_swaglint_use_global
g:ale_yaml_swaglint_use_global
Type: |String|
Default: `get(g:, 'ale_use_global_executables', 0)`
@@ -166,38 +179,58 @@ Install yaml-language-server either globally or locally: >
npm install yaml-language-server # local
Options
-------------------------------------------------------------------------------
g:ale_yaml_ls_executable *g:ale_yaml_ls_executable*
Options
*ale-options.yaml_ls_executable*
*g:ale_yaml_ls_executable*
*b:ale_yaml_ls_executable*
yaml_ls_executable
g: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*
*ale-options.yaml_ls_config*
*g:ale_yaml_ls_config*
*b:ale_yaml_ls_config*
yaml_ls_config
g: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,
\ },
\ },
\ }
A Dictionary for settings to pass to the language server. For example, to
enable the schema store, you can do use the following in your yaml ftplugin
file: >
let b:ale_yaml_ls_config = {
\ 'yaml': {
\ 'schemaStore': {
\ 'enable': v:true,
\ },
\ },
\}
<
Or in Lua: >
require("ale").setup.buffer({
yaml_ls_config = {
yaml = {
schemaStore = {
enable = true,
},
},
},
})
<
Consult the yaml-language-server documentation for more information about
settings.
g:ale_yaml_ls_use_global *g:ale_yaml_ls_use_global*
*ale-options.yaml_ls_use_global*
*g:ale_yaml_ls_use_global*
*b:ale_yaml_ls_use_global*
yaml_ls_use_global
g:ale_yaml_ls_use_global
Type: |String|
Default: `get(g:, 'ale_use_global_executables', 0)`
@@ -218,25 +251,33 @@ Install yamlfix: >
pip install yamlfix
<
Options
-------------------------------------------------------------------------------
g:ale_yaml_yamlfix_executable *g:ale_yaml_yamlfix_executable*
Options
*ale-options.yaml_yamlfix_executable*
*g:ale_yaml_yamlfix_executable*
*b:ale_yaml_yamlfix_executable*
yaml_yamlfix_executable
g:ale_yaml_yamlfix_executable
Type: |String|
Default: `'yamlfix'`
See |ale-integrations-local-executables|
g:ale_yaml_yamlfix_options *g:ale_yaml_yamlfix_options*
*ale-options.yaml_yamlfix_options*
*g:ale_yaml_yamlfix_options*
*b:ale_yaml_yamlfix_options*
yaml_yamlfix_options
g: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*
*ale-options.yaml_yamlfix_use_global*
*g:ale_yaml_yamlfix_use_global*
*b:ale_yaml_yamlfix_use_global*
yaml_yamlfix_use_global
g:ale_yaml_yamlfix_use_global
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
@@ -249,32 +290,41 @@ yamlfmt *ale-yaml-yamlfmt*
Website: https://github.com/google/yamlfmt
Installation
-------------------------------------------------------------------------------
Installation
Install yamlfmt:
See the website.
Options
-------------------------------------------------------------------------------
g:ale_yaml_yamlfmt_executable *g:ale_yaml_yamlfmt_executable*
Options
*ale-options.yaml_yamlfmt_executable*
*g:ale_yaml_yamlfmt_executable*
*b:ale_yaml_yamlfmt_executable*
yaml_yamlfmt_executable
g:ale_yaml_yamlfmt_executable
Type: |String|
Default: `'yamlfmt'`
See |ale-integrations-local-executables|
g:ale_yaml_yamlfmt_options *g:ale_yaml_yamlfmt_options*
*ale-options.yaml_yamlfmt_options*
*g:ale_yaml_yamlfmt_options*
*b:ale_yaml_yamlfmt_options*
yaml_yamlfmt_options
g:ale_yaml_yamlfmt_options
Type: |String|
Default: `''`
This variable can be set to pass extra options to yamlfmt.
g:ale_yaml_yamlfmt_use_global *g:ale_yaml_yamlfmt_use_global*
*ale-options.yaml_yamlfmt_use_global*
*g:ale_yaml_yamlfmt_use_global*
*b:ale_yaml_yamlfmt_use_global*
yaml_yamlfmt_use_global
g:ale_yaml_yamlfmt_use_global
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
@@ -287,8 +337,8 @@ yamllint *ale-yaml-yamllint*
Website: https://github.com/adrienverge/yamllint
Installation
-------------------------------------------------------------------------------
Installation
Install yamllint in your a virtualenv directory, locally, or globally: >
@@ -300,19 +350,23 @@ 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*
Options
*ale-options.yaml_yamllint_executable*
*g:ale_yaml_yamllint_executable*
*b:ale_yaml_yamllint_executable*
yaml_yamllint_executable
g: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*
*ale-options.yaml_yamllint_options*
*g:ale_yaml_yamllint_options*
*b:ale_yaml_yamllint_options*
yaml_yamllint_options
g:ale_yaml_yamllint_options
Type: |String|
Default: `''`
@@ -325,8 +379,8 @@ gitlablint *ale-yaml-gitlablint
Website: https://github.com/elijah-roberts/gitlab-lint
Installation
-------------------------------------------------------------------------------
Installation
Install yamllint in your a virtualenv directory, locally, or globally: >
@@ -347,19 +401,23 @@ applies to 'gitlab-ci.yml' files and not all yaml files:
\}
<
Options
-------------------------------------------------------------------------------
g:ale_yaml_gitlablint_executable *g:ale_yaml_gitlablint_executable*
Options
*ale-options.yaml_gitlablint_executable*
*g:ale_yaml_gitlablint_executable*
*b:ale_yaml_gitlablint_executable*
yaml_gitlablint_executable
g: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*
*ale-options.yaml_gitlablint_options*
*g:ale_yaml_gitlablint_options*
*b:ale_yaml_gitlablint_options*
yaml_gitlablint_options
g:ale_yaml_gitlablint_options
Type: |String|
Default: `''`
@@ -372,33 +430,41 @@ yq *ale-yaml-yq
Website: https://github.com/mikefarah/yq
Installation
-------------------------------------------------------------------------------
Installation
Install yq: >
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - | tar xz && mv ${BINARY} /usr/bin/yq
Options
-------------------------------------------------------------------------------
g:ale_yaml_yq_executable *g:ale_yaml_yq_executable*
-------------------------------------------------------------------------------
Options
*ale-options.yaml_yq_executable*
*g:ale_yaml_yq_executable*
*b:ale_yaml_yq_executable*
yaml_yq_executable
g:ale_yaml_yq_executable
Type: |String|
Default: `'yq'`
This variable can be set to change the path to yq.
g:ale_yaml_yq_options *g:ale_yaml_yq_options*
*ale-options.yaml_yq_options*
*g:ale_yaml_yq_options*
*b:ale_yaml_yq_options*
yaml_yq_options
g:ale_yaml_yq_options
Type: |String|
Default: `''`
This variable can be set to pass additional options to yq.
g:ale_yaml_yq_filters *g:ale_yaml_yq_filters
*ale-options.yaml_yq_filters*
*g:ale_yaml_yq_filters*
*b:ale_yaml_yq_filters*
yaml_yq_filters
g:ale_yaml_yq_filters
Type: |String|
Default: `'.'`