Fix markdownlint fixer and add markdownlint-cli2 (#5165)

* fix(tests): fix ale_c_build_dir_names being unset in tests (#5109)

- Use ale#Set() to set the ale_c_build_dir_names variable.
- Ensure SetUpLinterTest() is called before any Save commands in tests.
- Add c.vim to runtime before non-linter tests are executed.
- Remove workarounds in c.vim.

* feat: Load Prettier from cjs also

* fix: wrong command for markdownlint

* feat: explicit support for markdownlint-cli2

- Add markdownlint-cli2 linter and fixer, separate from markdownilnt-cli
- Rename markdownlint to markdownlint-cli
- Keep markdownlint as alias for markdownlint-cli

---------

Co-authored-by: w0rp <devw0rp@gmail.com>
Co-authored-by: Horacio Sanson <horacio.sanson@dena.jp>
This commit is contained in:
Horacio Sanson
2026-08-21 11:22:09 +09:00
committed by GitHub
co-authored by w0rp Horacio Sanson
parent 1c6e71732f
commit eff718bee9
15 changed files with 269 additions and 30 deletions
@@ -0,0 +1,29 @@
" Author: Horacio Sanson
" Description: Adds support for markdownlint-cli2
call ale#Set('markdown_markdownlint_cli2_executable', 'markdownlint-cli2')
call ale#Set('markdown_markdownlint_cli2_options', '')
function! ale_linters#markdown#markdownlint_cli2#GetExecutable(buffer) abort
return ale#handlers#markdownlint#GetExecutable(
\ a:buffer,
\ 'markdownlint_cli2',
\)
endfunction
function! ale_linters#markdown#markdownlint_cli2#GetCommand(buffer) abort
return ale#handlers#markdownlint#GetCommand(
\ a:buffer,
\ 'markdownlint_cli2',
\)
endfunction
call ale#linter#Define('markdown', {
\ 'name': 'markdownlint_cli2',
\ 'aliases': ['markdownlint-cli2'],
\ 'executable': function('ale_linters#markdown#markdownlint_cli2#GetExecutable'),
\ 'lint_file': 1,
\ 'output_stream': 'both',
\ 'command': function('ale_linters#markdown#markdownlint_cli2#GetCommand'),
\ 'callback': 'ale#handlers#markdownlint#Handle',
\})