All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 call ale#assert#SetUpLinterTest('sh', 'shellcheck')
3 call ale#test#SetFilename('test.sh')
5 let b:suffix = ' -f gcc -'
10 call ale#assert#TearDownLinterTest()
12 Execute(The default shellcheck command should be correct):
13 AssertLinterCwd '%s:h'
14 AssertLinter 'shellcheck', ale#Escape('shellcheck') . b:suffix
16 Execute(The option disabling changing directories should work):
17 let g:ale_sh_shellcheck_change_directory = 0
20 AssertLinter 'shellcheck', ale#Escape('shellcheck') . b:suffix
22 Execute(The shellcheck command should accept options):
23 let b:ale_sh_shellcheck_options = '--foobar'
25 AssertLinter 'shellcheck', ale#Escape('shellcheck') . ' --foobar' . b:suffix
27 Execute(The shellcheck command should accept options and exclusions):
28 let b:ale_sh_shellcheck_options = '--foobar'
29 let b:ale_sh_shellcheck_exclusions = 'foo,bar'
31 AssertLinter 'shellcheck',
32 \ ale#Escape('shellcheck') . ' --foobar -e foo,bar' . b:suffix
34 Execute(The shellcheck command should include the dialect):
37 AssertLinter 'shellcheck', ale#Escape('shellcheck') . ' -s bash' . b:suffix
39 Execute(The shellcheck command should use ale_sh_shellcheck_dialect):
40 let b:ale_sh_shellcheck_dialect = 'ksh93'
42 AssertLinter 'shellcheck', ale#Escape('shellcheck') . ' -s ksh93' . b:suffix
44 Execute(The shellcheck command should allow unspecified dialect):
45 let b:ale_sh_shellcheck_dialect = ''
47 AssertLinter 'shellcheck', ale#Escape('shellcheck') . b:suffix
49 Execute(The shellcheck command should include the dialect before options and exclusions):
51 let b:ale_sh_shellcheck_options = '--foobar'
52 let b:ale_sh_shellcheck_exclusions = 'foo,bar'
54 AssertLinter 'shellcheck', ale#Escape('shellcheck')
55 \ . ' -s bash --foobar -e foo,bar'
58 Execute(The -x option should be added when the version is new enough):
59 AssertLinter 'shellcheck', [
60 \ ale#Escape('shellcheck') . ' --version',
61 \ ale#Escape('shellcheck') . b:suffix,
65 \ 'ShellCheck - shell script analysis tool',
67 \ 'license: GNU General Public License, version 3',
68 \ 'website: http://www.shellcheck.net',
70 AssertLinter 'shellcheck', [
71 \ ale#Escape('shellcheck') . ' --version',
72 \ ale#Escape('shellcheck') . ' -x' . b:suffix,
75 " We should cache the version check
77 AssertLinter 'shellcheck', [
78 \ ale#Escape('shellcheck') . ' -x' . b:suffix,
81 Execute(The -x option should not be added when the version is too old):
83 \ 'ShellCheck - shell script analysis tool',
85 \ 'license: GNU General Public License, version 3',
86 \ 'website: http://www.shellcheck.net',
88 AssertLinter 'shellcheck', [
89 \ ale#Escape('shellcheck') . ' --version',
90 \ ale#Escape('shellcheck') . b:suffix,
93 Execute(The version check shouldn't be run again for old versions):
95 \ 'ShellCheck - shell script analysis tool',
97 \ 'license: GNU General Public License, version 3',
98 \ 'website: http://www.shellcheck.net',
100 AssertLinter 'shellcheck', [
101 \ ale#Escape('shellcheck') . ' --version',
102 \ ale#Escape('shellcheck') . b:suffix,
104 AssertLinter 'shellcheck', [
105 \ ale#Escape('shellcheck') . b:suffix,