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

Merge commit 'a39f715c13be3352193ffd9c5b7536b8786eff64' as '.vim/bundle/vim-lsp'
[etc/vim.git] / .vim / bundle / ale / ale_linters / awk / gawk.vim
1 " Author: kmarc <korondi.mark@gmail.com>
2 " Description: This file adds support for using GNU awk with scripts.
3
4 call ale#Set('awk_gawk_executable', 'gawk')
5 call ale#Set('awk_gawk_options', '')
6
7 function! ale_linters#awk#gawk#GetCommand(buffer) abort
8     " note the --source 'BEGIN ...' is to prevent
9     " gawk from attempting to execute the body of the script
10     " it is linting.
11     return '%e --source ' . ale#Escape('BEGIN { exit } END { exit 1 }')
12     \   . ' --lint'
13     \   .  ale#Pad(ale#Var(a:buffer, 'awk_gawk_options'))
14     \   . ' -f %t /dev/null'
15 endfunction
16
17 call ale#linter#Define('awk', {
18 \   'name': 'gawk',
19 \   'executable': {b -> ale#Var(b, 'awk_gawk_executable')},
20 \   'command': function('ale_linters#awk#gawk#GetCommand'),
21 \   'callback': 'ale#handlers#gawk#HandleGawkFormat',
22 \   'output_stream': 'both'
23 \})