]> git.madduck.net Git - etc/vim.git/blob - ale_linters/inko/inko.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:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / ale_linters / inko / inko.vim
1 " Author: Yorick Peterse <yorick@yorickpeterse.com>
2 " Description: linting of Inko source code using the Inko compiler
3
4 call ale#Set('inko_inko_executable', 'inko')
5
6 function! ale_linters#inko#inko#GetCommand(buffer) abort
7     let l:include = ''
8
9     " Include the tests source directory, but only for test files.
10     if expand('#' . a:buffer . ':p') =~? '\vtests[/\\]test[/\\]'
11         let l:test_dir = ale#path#FindNearestDirectory(a:buffer, 'tests')
12
13         if isdirectory(l:test_dir)
14             let l:include = '--include ' . ale#Escape(l:test_dir)
15         endif
16     endif
17
18     " We use %s instead of %t so the compiler determines the correct module
19     " names for the file being edited. Not doing so may lead to errors in
20     " certain cases.
21     return '%e build --check --format=json'
22     \ . ale#Pad(l:include)
23     \ . ' %s'
24 endfunction
25
26 call ale#linter#Define('inko', {
27 \   'name': 'inko',
28 \   'executable': {b -> ale#Var(b, 'inko_inko_executable')},
29 \   'command': function('ale_linters#inko#inko#GetCommand'),
30 \   'callback': 'ale#handlers#inko#Handle',
31 \   'output_stream': 'stderr',
32 \   'lint_file': 1
33 \})