]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/ale_linters/cairo/scarb.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

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.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / ale_linters / cairo / scarb.vim
1 " Author: 0xhyoga <0xhyoga@gmx.com>,
2 " Description: scarb for cairo files
3
4 function! ale_linters#cairo#scarb#GetScarbExecutable(bufnr) abort
5     if ale#path#FindNearestFile(a:bufnr, 'Scarb.toml') isnot# ''
6         return 'scarb'
7     else
8         " if there is no Scarb.toml file, we don't use scarb even if it exists,
9         " so we return '', because executable('') apparently always fails
10         return ''
11     endif
12 endfunction
13
14 function! ale_linters#cairo#scarb#GetCommand(buffer, version) abort
15     return 'scarb build'
16 endfunction
17
18 call ale#linter#Define('cairo', {
19 \   'name': 'scarb',
20 \   'executable': function('ale_linters#cairo#scarb#GetScarbExecutable'),
21 \   'command': {buffer -> ale#semver#RunWithVersionCheck(
22 \       buffer,
23 \       ale_linters#cairo#scarb#GetScarbExecutable(buffer),
24 \       '%e --version',
25 \       function('ale_linters#cairo#scarb#GetCommand'),
26 \   )},
27 \   'callback': 'ale#handlers#cairo#HandleCairoErrors',
28 \   'output_stream': 'both',
29 \   'lint_file': 1,
30 \})
31