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: 0xHyoga <0xHyoga@gmx.com>
2 " Description: Report Starknet compile to sierra errors in cairo 1.0 code
4 call ale#Set('cairo_sierra_executable', 'starknet-compile')
5 call ale#Set('cairo_sierra_options', '')
7 function! ale_linters#cairo#sierra#Handle(buffer, lines) abort
8 " Matches patterns like the following:
9 " Error: Expected ';' but got '('
10 " --> /path/to/file/file.cairo:1:10:)
11 let l:pattern = '\v(error|warning): (.*)$'
12 let l:line_and_column_pattern = '\v\.cairo:(\d+):(\d+)'
16 let l:match = matchlist(l:line, l:pattern)
19 let l:match = matchlist(l:line, l:line_and_column_pattern)
22 let l:index = len(l:output) - 1
23 let l:output[l:index]['lnum'] = l:match[1] + 0
24 let l:output[l:index]['col'] = l:match[2] + 0
27 let l:isError = l:match[1] is? 'Error'
33 \ 'type': l:isError ? 'E' : 'W',
41 function! ale_linters#cairo#sierra#GetCommand(buffer) abort
42 let l:executable = ale#Var(a:buffer, 'cairo_sierra_executable')
44 return l:executable . ale#Pad(ale#Var(a:buffer, 'cairo_sierra_options')) . ' %s'
47 call ale#linter#Define('cairo', {
49 \ 'executable': {b -> ale#Var(b, 'cairo_sierra_executable')},
50 \ 'command': function('ale_linters#cairo#sierra#GetCommand'),
51 \ 'callback': 'ale_linters#cairo#sierra#Handle',
52 \ 'output_stream': 'stderr',