mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-07 18:31:04 +08:00
* Add Statix for Linting Add `statix check` as a linter. Provides a simple set of definition tests additionally. Variable names specify "check" to allow for later addition of `statix fix` as a formatter once stream support is added. Signed-off-by: David Houston <houstdav000@gmail.com> * Fixup Supported Tools List I didn't realise there were two separate lists of tools, so add statix to the other list. Also, remembered "S" comes after "R", and so re-ordered it. Signed-off-by: David Houston <houstdav000@gmail.com> * Fix statix Test File I refactored the variables for statix to allow for writing a fixer later, and forgot to update them in the test, so update them now. Also remove a stray "i", add missing space before checks Signed-off-by: David Houston <houstdav000@gmail.com> * Update Output Stream for v0.4.0 statix v0.4.0 provides a breaking change of output stream from stderr to stdout. Signed-off-by: David Houston <houstdav000@gmail.com> * Add statix fix Fixer Implement statix fix as a fixer for simple Nix antipatterns. Signed-off-by: David Houston <houstdav000@gmail.com> * Fix statix Fixer Tests Fix the statix fixer tests by removing the unnecessary 'read_temporary_file' value from the command, since it simply uses the default value. Signed-off-by: David Houston <houstdav000@gmail.com> * Add statix Handler Test Add a test for the statix handler per @hsanson's request. Signed-off-by: David Houston <houstdav000@gmail.com> * Fix to run only on stdin for linting Signed-off-by: David Houston <houstdav000@gmail.com>
18 lines
562 B
VimL
18 lines
562 B
VimL
" Author: David Houston <houstdav000>
|
|
" Description: Provide statix fix as a fixer for simple Nix antipatterns.
|
|
|
|
call ale#Set('nix_statix_fix_executable', 'statix')
|
|
call ale#Set('nix_statix_fix_options', '')
|
|
|
|
function! ale#fixers#statix#Fix(buffer) abort
|
|
let l:executable = ale#Var(a:buffer, 'nix_statix_fix_executable')
|
|
let l:options = ale#Var(a:buffer, 'nix_statix_fix_options')
|
|
|
|
return {
|
|
\ 'command': ale#Escape(l:executable)
|
|
\ . ale#Pad('fix')
|
|
\ . ale#Pad('--stdin')
|
|
\ . ale#Pad(l:options),
|
|
\}
|
|
endfunction
|