All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Author: KabbAmine <amine.kabb@gmail.com>, David Sierra <https://github.com/davidsierradz>
3 call ale#Set('json_jsonlint_executable', 'jsonlint')
4 call ale#Set('json_jsonlint_use_global', get(g:, 'ale_use_global_executables', 0))
6 function! ale_linters#json#jsonlint#GetExecutable(buffer) abort
7 return ale#path#FindExecutable(a:buffer, 'json_jsonlint', [
8 \ 'node_modules/.bin/jsonlint',
9 \ 'node_modules/jsonlint/lib/cli.js',
13 function! ale_linters#json#jsonlint#GetCommand(buffer) abort
14 let l:executable = ale_linters#json#jsonlint#GetExecutable(a:buffer)
16 return ale#node#Executable(a:buffer, l:executable)
20 function! ale_linters#json#jsonlint#Handle(buffer, lines) abort
21 " Matches patterns like the following:
22 " line 2, col 15, found: 'STRING' - expected: 'EOF', '}', ',', ']'.
23 let l:pattern = '^line \(\d\+\), col \(\d*\), \(.\+\)$'
26 for l:match in ale#util#GetMatches(a:lines, l:pattern)
28 \ 'lnum': l:match[1] + 0,
29 \ 'col': l:match[2] + 0,
37 call ale#linter#Define('json', {
39 \ 'executable': function('ale_linters#json#jsonlint#GetExecutable'),
40 \ 'output_stream': 'stderr',
41 \ 'command': function('ale_linters#json#jsonlint#GetCommand'),
42 \ 'callback': 'ale_linters#json#jsonlint#Handle',