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: Roeland Moors - https://github.com/roelandmoors
2 " based on the ale ruumba and robocop linters
3 " Description: ERB Lint, support for https://github.com/Shopify/erb-lint
5 call ale#Set('eruby_erblint_executable', 'erblint')
6 call ale#Set('eruby_erblint_options', '')
8 function! ale_linters#eruby#erblint#GetCommand(buffer) abort
9 let l:executable = ale#Var(a:buffer, 'eruby_erblint_executable')
11 return ale#ruby#EscapeExecutable(l:executable, 'erblint')
13 \ . ale#Var(a:buffer, 'eruby_erblint_options')
17 function! ale_linters#eruby#erblint#Handle(buffer, lines) abort
22 let l:errors = ale#util#FuzzyJSONDecode(a:lines[0], [])
24 if !has_key(l:errors, 'summary')
25 \|| l:errors['summary']['offenses'] == 0
26 \|| empty(l:errors['files'])
32 for l:error in l:errors['files'][0]['offenses']
34 \ 'lnum': l:error['location']['start_line'] + 0,
35 \ 'col': l:error['location']['start_column'] + 0,
36 \ 'end_col': l:error['location']['last_column'] + 0,
37 \ 'code': l:error['linter'],
38 \ 'text': l:error['message'],
46 call ale#linter#Define('eruby', {
48 \ 'executable': {b -> ale#Var(b, 'eruby_erblint_executable')},
49 \ 'command': function('ale_linters#eruby#erblint#GetCommand'),
50 \ 'callback': 'ale_linters#eruby#erblint#Handle',