diff --git a/linter.py b/linter.py index dae1b7a..6d5a32b 100644 --- a/linter.py +++ b/linter.py @@ -5,9 +5,24 @@ class Shellcheck(Linter): - cmd = 'shellcheck --format=gcc ${args} -' - if sublime.platform() == 'windows' and not which('shellcheck') and which('wsl'): - cmd = 'wsl ' + cmd + def cmd(self): + cmd = [] + if sublime.platform() == 'windows' and not which('shellcheck') and which('wsl'): + cmd.append('wsl') + + cmd.extend([ + 'shellcheck', + '--format=gcc', + '--external-sources', + ]) + + if self.filename.endswith('.ebuild'): + cmd.append('--shell=bash') + + cmd.append('${args}') + cmd.append('-') + + return cmd regex = ( r'^.+?:(?P\d+):(?P\d+): '