summaryrefslogtreecommitdiff
path: root/ale_linters/awk
diff options
context:
space:
mode:
authorMark Korondi <korondi.mark@gmail.com>2017-06-08 19:26:21 +0200
committerw0rp <w0rp@users.noreply.github.com>2017-06-08 18:26:21 +0100
commit64ad51048d8f490b57ca6e74864f4de3777ec2a7 (patch)
treec657a7dccd67de80518d56d90dc55b39c5bd88c1 /ale_linters/awk
parent62862c334776e3138f5a5456ed41bb146969b2c2 (diff)
downloadale-64ad51048d8f490b57ca6e74864f4de3777ec2a7.zip
Support for GNU Awk linting (#638)
* GNU Awk linter support * Documentation for awk linter
Diffstat (limited to 'ale_linters/awk')
-rw-r--r--ale_linters/awk/gawk.vim26
1 files changed, 26 insertions, 0 deletions
diff --git a/ale_linters/awk/gawk.vim b/ale_linters/awk/gawk.vim
new file mode 100644
index 00000000..ac6e9154
--- /dev/null
+++ b/ale_linters/awk/gawk.vim
@@ -0,0 +1,26 @@
+" Author: kmarc <korondi.mark@gmail.com>
+" Description: This file adds support for using GNU awk with sripts.
+
+let g:ale_awk_gawk_executable =
+\ get(g:, 'ale_awk_gawk_executable', 'gawk')
+
+let g:ale_awk_gawk_options =
+\ get(g:, 'ale_awk_gawk_options', '')
+
+function! ale_linters#awk#gawk#GetExecutable(buffer) abort
+ return ale#Var(a:buffer, 'awk_gawk_executable')
+endfunction
+
+function! ale_linters#awk#gawk#GetCommand(buffer) abort
+ return ale_linters#awk#gawk#GetExecutable(a:buffer)
+ \ . ' ' . ale#Var(a:buffer, 'awk_gawk_options')
+ \ . ' ' . '-f %t --lint /dev/null'
+endfunction
+
+call ale#linter#Define('awk', {
+\ 'name': 'gawk',
+\ 'executable_callback': 'ale_linters#awk#gawk#GetExecutable',
+\ 'command_callback': 'ale_linters#awk#gawk#GetCommand',
+\ 'callback': 'ale#handlers#cpplint#HandleCppLintFormat',
+\ 'output_stream': 'both'
+\})