summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorAlbert Peschar <albert@peschar.net>2023-03-07 02:31:14 +0100
committerGitHub <noreply@github.com>2023-03-07 01:31:14 +0000
commit6ae26df22b982e8b19824af96b3e937a0de0bf59 (patch)
tree2d996429f30131a3b3f0e13bf13a4feddd5ef234 /autoload
parentc8e914604963063b7bb827e9b6f5a6ca741dad60 (diff)
downloadale-6ae26df22b982e8b19824af96b3e937a0de0bf59.zip
Add deadnix linter (#4443)
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/deadnix.vim33
1 files changed, 33 insertions, 0 deletions
diff --git a/autoload/ale/handlers/deadnix.vim b/autoload/ale/handlers/deadnix.vim
new file mode 100644
index 00000000..8f03f38e
--- /dev/null
+++ b/autoload/ale/handlers/deadnix.vim
@@ -0,0 +1,33 @@
+function! ale#handlers#deadnix#Handle(buffer, lines) abort
+ let l:output = []
+
+ for l:line in a:lines
+ try
+ let l:file = ale#util#FuzzyJSONDecode(l:line, v:null)
+ catch
+ continue
+ endtry
+
+ if type(l:file) isnot v:t_dict
+ continue
+ endif
+
+ for l:error in l:file['results']
+ try
+ let l:ale_error = {
+ \ 'lnum': l:error['line'],
+ \ 'col': l:error['column'],
+ \ 'end_col': l:error['endColumn'],
+ \ 'text': l:error['message'],
+ \ 'type': 'W',
+ \}
+ catch
+ continue
+ endtry
+
+ call add(l:output, l:ale_error)
+ endfor
+ endfor
+
+ return l:output
+endfunction