cros lint: check basic whitespace issues in shell scripts
We should be able to enforce basic whitespace rules on shell scripts.
BUG=None
TEST=`cros lint` on bad shell scripts throws errors
Change-Id: Ibe3b7819700cd3f95f704dcc477af87f99a1104a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2658932
Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/cli/cros/cros_lint.py b/cli/cros/cros_lint.py
index ea0f421..9ad27dc 100644
--- a/cli/cros/cros_lint.py
+++ b/cli/cros/cros_lint.py
@@ -361,6 +361,11 @@
'errors. If the shellcheck findings are not useful, '
'please file a bug at:\n%s', bug_url)
lint_result.returncode = 0
+
+ # Check whitespace.
+ if not _WhiteSpaceLintData(path, osutils.ReadFile(path)):
+ lint_result.returncode = 1
+
return lint_result