summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorDavid Houston <houstdav000@gmail.com>2021-11-17 23:00:45 -0500
committerGitHub <noreply@github.com>2021-11-18 13:00:45 +0900
commit2cfeabd1b595805e506e7d79347e30e9a52084d1 (patch)
treeed344a3057ec539f258353e2ea81d86142ac75e4 /autoload
parent3b8ff6536e6eb4b9af946e2028164e8966ec5458 (diff)
downloadale-2cfeabd1b595805e506e7d79347e30e9a52084d1.zip
Rewrite Alex Integration to Use stdin (#3982)
Since having been added, the `alex` tool has added support for linting on stdin. Rewrite this integration to reduce the number of tools requiring disk-write access. Signed-off-by: David Houston <houstdav000@gmail.com>
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/alex.vim7
1 files changed, 4 insertions, 3 deletions
diff --git a/autoload/ale/handlers/alex.vim b/autoload/ale/handlers/alex.vim
index 6ef4867f..1a92bd14 100644
--- a/autoload/ale/handlers/alex.vim
+++ b/autoload/ale/handlers/alex.vim
@@ -11,8 +11,9 @@ endfunction
function! ale#handlers#alex#CreateCommandCallback(flags) abort
return {b -> ale#node#Executable(b, ale#handlers#alex#GetExecutable(b))
- \ . ' %s '
- \ . a:flags}
+ \ . ' --stdin '
+ \ . a:flags
+ \}
endfunction
function! ale#handlers#alex#Handle(buffer, lines) abort
@@ -38,6 +39,7 @@ endfunction
" Define a linter for a specific filetype. Accept flags to adapt to the filetype.
" no flags treat input as markdown
" --html treat input as HTML
+" --mdx treat input as MDX
" --text treat input as plaintext
function! ale#handlers#alex#DefineLinter(filetype, flags) abort
call ale#Set('alex_executable', 'alex')
@@ -49,6 +51,5 @@ function! ale#handlers#alex#DefineLinter(filetype, flags) abort
\ 'command': ale#handlers#alex#CreateCommandCallback(a:flags),
\ 'output_stream': 'stderr',
\ 'callback': 'ale#handlers#alex#Handle',
- \ 'lint_file': 1,
\})
endfunction