From 92e6e4d1ba482a4d2d89d850f660c67ccf8a28eb Mon Sep 17 00:00:00 2001 From: Anthony DeDominic Date: Wed, 14 Mar 2018 13:46:57 -0400 Subject: Fix awk linter and security concerns. (#1411) * Fixed (g)awk linter * Made it secure, albeit less useful. * Added gawk handler; the cpplint one was not working? * Added gawk handler test. * added warning to gawk handler. * added gawk command callback test * added comment about --source * added back optional commandline option --- ale_linters/awk/gawk.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ale_linters/awk/gawk.vim') diff --git a/ale_linters/awk/gawk.vim b/ale_linters/awk/gawk.vim index ac6e9154..3e9987b3 100644 --- a/ale_linters/awk/gawk.vim +++ b/ale_linters/awk/gawk.vim @@ -12,7 +12,11 @@ function! ale_linters#awk#gawk#GetExecutable(buffer) abort endfunction function! ale_linters#awk#gawk#GetCommand(buffer) abort + " note the --source 'BEGIN ...' is to prevent + " gawk from attempting to execute the body of the script + " it is linting. return ale_linters#awk#gawk#GetExecutable(a:buffer) + \ . " --source 'BEGIN { exit } END { exit 1 }'" \ . ' ' . ale#Var(a:buffer, 'awk_gawk_options') \ . ' ' . '-f %t --lint /dev/null' endfunction @@ -21,6 +25,6 @@ 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', +\ 'callback': 'ale#handlers#gawk#HandleGawkFormat', \ 'output_stream': 'both' \}) -- cgit v1.2.3