mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
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
This commit is contained in:
39
test/handler/test_gawk_handler.vader
Normal file
39
test/handler/test_gawk_handler.vader
Normal file
@@ -0,0 +1,39 @@
|
||||
Before:
|
||||
runtime ale_linters/awk/gawk.vim
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(gawk syntax errors should be parsed correctly):
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 1,
|
||||
\ 'col': 0,
|
||||
\ 'text': "invalid char ''' in expression",
|
||||
\ 'code': 0,
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 5,
|
||||
\ 'col': 0,
|
||||
\ 'text': 'unterminated string',
|
||||
\ 'code': 0,
|
||||
\ 'type': 'E',
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 10,
|
||||
\ 'col': 0,
|
||||
\ 'text': "escape sequence `\u' treated as plain `u'",
|
||||
\ 'code': 0,
|
||||
\ 'type': 'W',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale#handlers#gawk#HandleGawkFormat(347, [
|
||||
\ "gawk: something.awk:1: BEGIN { system('touch aaaaaaaaa') }",
|
||||
\ "gawk: something.awk:1: ^ invalid char ''' in expression",
|
||||
\ 'gawk: something.awk:5: { x = "aaaaaaaaaaa',
|
||||
\ 'gawk: something.awk:5: ^ unterminated string',
|
||||
\ "gawk: something.awk:10: warning: escape sequence `\u' treated as plain `u'",
|
||||
\ ])
|
||||
Reference in New Issue
Block a user