From 56f633750242bfd769112b9a9bf3b06440476695 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Mon, 7 Oct 2019 14:16:42 -0600 Subject: [PATCH 1/2] Special case .ebuild Gentoo Portage ebuilds are simply bash. They don't have the header to indicate that though. Pass the shell explicitly for ebuilds. Signed-off-by: Raul E Rangel --- linter.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/linter.py b/linter.py index dae1b7a..d6c5d53 100644 --- a/linter.py +++ b/linter.py @@ -5,9 +5,23 @@ 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', + ]) + + if self.filename.endswith('.ebuild'): + cmd.append('--shell=bash') + + cmd.append('${args}') + cmd.append('-') + + return cmd regex = ( r'^.+?:(?P\d+):(?P\d+): ' From 3a1420df5e59d3ae399c876db5dcd9f414edd8a8 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Mon, 7 Oct 2019 14:18:02 -0600 Subject: [PATCH 2/2] Allow external sources by default This allows linting `source`d files as well. Signed-off-by: Raul E Rangel --- linter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/linter.py b/linter.py index d6c5d53..6d5a32b 100644 --- a/linter.py +++ b/linter.py @@ -13,6 +13,7 @@ def cmd(self): cmd.extend([ 'shellcheck', '--format=gcc', + '--external-sources', ]) if self.filename.endswith('.ebuild'):