forked from github-mirrors/ale
80 lines
2.3 KiB
Plaintext
80 lines
2.3 KiB
Plaintext
Before:
|
|
Save g:ale_linters
|
|
Save g:ale_linters_explicit
|
|
|
|
let g:ale_linters_explicit = 0
|
|
let g:ale_linters = {}
|
|
|
|
function! GetLinterNames(filetype) abort
|
|
return map(ale#linter#Get(a:filetype), 'v:val.name')
|
|
endfunction
|
|
|
|
After:
|
|
Restore
|
|
|
|
call ale#linter#Reset()
|
|
|
|
Execute(The defaults for the csh filetype should be correct):
|
|
AssertEqual ['shell'], GetLinterNames('csh')
|
|
|
|
let g:ale_linters_explicit = 1
|
|
|
|
AssertEqual [], GetLinterNames('csh')
|
|
|
|
Execute(The defaults for the go filetype should be correct):
|
|
AssertEqual ['gofmt', 'golint', 'gopls', 'govet'], GetLinterNames('go')
|
|
|
|
let g:ale_linters_explicit = 1
|
|
|
|
AssertEqual [], GetLinterNames('go')
|
|
|
|
Execute(The defaults for the help filetype should be correct):
|
|
AssertEqual [], GetLinterNames('help')
|
|
|
|
Execute(The defaults for the python filetype should be correct):
|
|
AssertEqual ['flake8', 'mypy', 'pylint', 'pyright'], GetLinterNames('python')
|
|
|
|
let g:ale_linters_explicit = 1
|
|
|
|
AssertEqual [], GetLinterNames('python')
|
|
|
|
Execute(The defaults for the rust filetype should be correct):
|
|
AssertEqual ['cargo', 'rls'], GetLinterNames('rust')
|
|
|
|
let g:ale_linters_explicit = 1
|
|
|
|
AssertEqual [], GetLinterNames('rust')
|
|
|
|
Execute(The defaults for the spec filetype should be correct):
|
|
AssertEqual [], GetLinterNames('spec')
|
|
|
|
Execute(The defaults for the text filetype should be correct):
|
|
AssertEqual [], GetLinterNames('text')
|
|
|
|
Execute(The defaults for the zsh filetype should be correct):
|
|
AssertEqual ['shell'], GetLinterNames('zsh')
|
|
|
|
let g:ale_linters_explicit = 1
|
|
|
|
AssertEqual [], GetLinterNames('zsh')
|
|
|
|
Execute(The defaults for the verilog filetype should be correct):
|
|
" This filetype isn't configured with default, so we can test loading all
|
|
" available linters with this.
|
|
AssertEqual ['hdl-checker', 'iverilog', 'verilator', 'vlog', 'xvlog'], GetLinterNames('verilog')
|
|
|
|
let g:ale_linters_explicit = 1
|
|
|
|
AssertEqual [], GetLinterNames('verilog')
|
|
|
|
Execute(Default aliases for React should be defined):
|
|
AssertEqual ['javascript', 'jsx'], ale#linter#ResolveFiletype('javascriptreact')
|
|
AssertEqual ['typescript', 'tsx'], ale#linter#ResolveFiletype('typescriptreact')
|
|
|
|
Execute(The defaults for the apkbuild filetype should be correct):
|
|
AssertEqual ['apkbuild_lint', 'secfixes_check'], GetLinterNames('apkbuild')
|
|
|
|
let g:ale_linters_explicit = 1
|
|
|
|
AssertEqual [], GetLinterNames('apkbuild')
|