mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-09 04:52:29 +08:00
Add initial support for named-checkzone linter (#4961)
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--lua-only) (push) Has been cancelled
CI / test_ale (--neovim-07-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Co-authored-by: ds <ds@local>
This commit is contained in:
26
test/handler/test_bindzone_checkzone.vader
Normal file
26
test/handler/test_bindzone_checkzone.vader
Normal file
@@ -0,0 +1,26 @@
|
||||
Before:
|
||||
runtime ale_linters/bindzone/checkzone.vim
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The checkzone handler should handle basic warnings):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 2,
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'unknown RR type ''fasd''',
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 0,
|
||||
\ 'type': 'W',
|
||||
\ 'text': '_some_srv._tcp.example.com/SRV ''some.example.com'' (out of zone) has no addresses records (A or AAAA)',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#bindzone#checkzone#Handle(1, [
|
||||
\ 'zone example.com/IN: _some_srv._tcp.example.com/SRV ''some.example.com'' (out of zone) has no addresses records (A or AAAA)',
|
||||
\ 'zone example.com/IN: loaded serial 2025050400',
|
||||
\ 'zone example.com/IN: not loaded due to errors',
|
||||
\ '/tmp/vb3wXsu/2/example.com:2: unknown RR type ''fasd''',
|
||||
\ ])
|
||||
19
test/linter/test_bindzone_checkzone.vader
Normal file
19
test/linter/test_bindzone_checkzone.vader
Normal file
@@ -0,0 +1,19 @@
|
||||
Before:
|
||||
call ale#assert#SetUpLinterTest('bindzone', 'checkzone')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The default command should be correct):
|
||||
AssertLinter 'named-checkzone',
|
||||
\ ale#Escape('named-checkzone') . ' -c IN example.com %t'
|
||||
|
||||
Execute(The default command should be overridden):
|
||||
let b:ale_bindzone_checkzone_executable = '/bin/bind9-checkzone'
|
||||
AssertLinter '/bin/bind9-checkzone',
|
||||
\ ale#Escape('/bin/bind9-checkzone') . ' -c IN example.com %t'
|
||||
|
||||
Execute(The default options should be overridden):
|
||||
let b:ale_bindzone_checkzone_options = '-c IN -d'
|
||||
AssertLinter 'named-checkzone',
|
||||
\ ale#Escape('named-checkzone') . ' -c IN -d example.com %t'
|
||||
Reference in New Issue
Block a user