summaryrefslogtreecommitdiff
path: root/ale_linters/nix/statix.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/nix/statix.vim')
-rw-r--r--ale_linters/nix/statix.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/ale_linters/nix/statix.vim b/ale_linters/nix/statix.vim
new file mode 100644
index 00000000..a90a68a6
--- /dev/null
+++ b/ale_linters/nix/statix.vim
@@ -0,0 +1,18 @@
+scriptencoding utf-8
+" Author: David Houston <houstdav000>
+" Description: statix analysis and suggestions for Nix files
+
+call ale#Set('nix_statix_check_executable', 'statix')
+call ale#Set('nix_statix_check_options', '')
+
+function! ale_linters#nix#statix#GetCommand(buffer) abort
+ return '%e check -o errfmt --stdin'
+ \ . ale#Pad(ale#Var(a:buffer, 'nix_statix_check_options'))
+endfunction
+
+call ale#linter#Define('nix', {
+\ 'name': 'statix',
+\ 'executable': {b -> ale#Var(b, 'nix_statix_check_executable')},
+\ 'command': function('ale_linters#nix#statix#GetCommand'),
+\ 'callback': 'ale#handlers#statix#Handle',
+\})