aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Deshpande <aditya.deshpande@linaro.org>2021-07-27 17:30:27 +0100
committerAditya Deshpande <aditya.deshpande@linaro.org>2021-08-17 12:01:37 +0100
commit9e9396d7896ccf4ee28bdb5f125b805a691b7cd9 (patch)
treebb8ca7ae6123005290defa426a53d6a1fd9f6695
parent96d6c69593fa88fc786247d6875f8103d836ced7 (diff)
downloadart-build-scripts-9e9396d7896ccf4ee28bdb5f125b805a691b7cd9.tar.gz
ART: Make presubmit.sh check for style.
Added checking for trailing whitespaces. Test: ./presubmit.sh Change-Id: Iea1fa2dc0f75a4b4de18a07000add077e97af486
-rwxr-xr-xpresubmit.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/presubmit.sh b/presubmit.sh
index 58f66282..55bfd23b 100755
--- a/presubmit.sh
+++ b/presubmit.sh
@@ -78,7 +78,13 @@ readonlyvars_tests() {
local -r str_local="local"
local -r str_ronly="readonly"
- ! grep -Hn --color -E "\<(${str_local} ${str_ronly}|${str_ronly} ${str_local})\>" "${shell_files[@]}"
+ ! grep -Hn --color -E "\<(${str_local} ${str_ronly}|${str_ronly} ${str_local})\>" \
+ "${shell_files[@]}"
+}
+
+# Check for trailing whitespaces
+trailing_whitespaces_tests() {
+ ! grep -n '[[:blank:]]$' "${shell_files[@]}"
}
main() {
@@ -87,6 +93,8 @@ main() {
if_error "shellcheck presubmit test FAILED."
readonlyvars_tests
if_error "Scope/read-only variables presubmit test FAILED."
+ trailing_whitespaces_tests
+ if_error "Trailing Whitespaces test FAILED"
log S "Presubmit tests PASSED."
exit 0
}