f49f615ef6
This PR first and formost implements support for dot-seperate filetypes, a very trivial change. This closes #132 But more importantly, this PR vastly improves the test quality for `ale#linter#Get`. It enables us to reset the state of ale's internal linter cache, to facilitate better testing, as well as making use of mocked linters instead of depending on linters on disk (which may change). In addition, a dummy linter is defined to test the autoloading behavior. Header guards were removed from all linters as: * A: ale won't try and load linters if they already exist in memory * B: we can't reset state for testing if they can't be loaded again
24 lines
799 B
VimL
24 lines
799 B
VimL
" Author: w0rp <devw0rp@gmail.com>
|
|
" Description: This file adds support for using the shellcheck linter with
|
|
" shell scripts.
|
|
|
|
" This global variable can be set with a string of comma-seperated error
|
|
" codes to exclude from shellcheck. For example:
|
|
"
|
|
" let g:ale_linters_sh_shellcheck_exclusions = 'SC2002,SC2004'
|
|
if !exists('g:ale_linters_sh_shellcheck_exclusions')
|
|
let g:ale_linters_sh_shellcheck_exclusions = ''
|
|
endif
|
|
|
|
if g:ale_linters_sh_shellcheck_exclusions !=# ''
|
|
let s:exclude_option = '-e ' . g:ale_linters_sh_shellcheck_exclusions
|
|
else
|
|
let s:exclude_option = ''
|
|
endif
|
|
|
|
call ale#linter#Define('sh', {
|
|
\ 'name': 'shellcheck',
|
|
\ 'executable': 'shellcheck',
|
|
\ 'command': 'shellcheck ' . s:exclude_option . ' -f gcc -',
|
|
\ 'callback': 'ale#handlers#HandleGCCFormat',
|
|
\})
|