summaryrefslogtreecommitdiff
path: root/ale_linters/openscad/sca2d.vim
blob: 60804a1387afba2c1de35091ad716b6c97412811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
" Description: SCA2D linter for OpenSCAD files

call ale#Set('openscad_sca2d_executable', 'sca2d')
call ale#Set('openscad_sca2d_options', '')

function! ale_linters#openscad#sca2d#GetExecutable(buffer) abort
    return ale#Var(a:buffer, 'openscad_sca2d_executable')
endfunction

function! ale_linters#openscad#sca2d#GetCommand(buffer) abort
    let l:executable = ale_linters#openscad#sca2d#GetExecutable(a:buffer)
    let l:options = ale#Var(a:buffer, 'openscad_sca2d_options')

    return ale#Escape(l:executable) . ale#Pad(l:options) . ' %s'
endfunction

call ale#linter#Define('openscad', {
\ 'name': 'SCA2D',
\ 'aliases': ['sca2d'],
\ 'executable': function('ale_linters#openscad#sca2d#GetExecutable'),
\ 'command': function('ale_linters#openscad#sca2d#GetCommand'),
\ 'callback': 'ale#handlers#openscad#SCA2D_callback',
\ 'lint_file': 1,
\ })