sanity-check: set shellcheck level to warning
This patch locks shellcheck severity level to "warning". All "info"
level messages will be ignored.
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@oss.qualcomm.com>
diff --git a/sanity-check.sh b/sanity-check.sh
index 1a2fa3e..9af667d 100755
--- a/sanity-check.sh
+++ b/sanity-check.sh
@@ -4,7 +4,8 @@
python3 validate.py \
-r build-error.txt \
-p E501 W503 E203 \
- -s SC1091 SC2230 SC3043
+ -s SC1091 SC2230 SC3043 \
+ -l warning
# pycodestyle checks skipped:
# E501: line too long
@@ -18,3 +19,5 @@
# Reason: 'which' is widely used and supported. And 'command' applets isn't
# available in busybox, refer to https://busybox.net/downloads/BusyBox.html
# SC2230: which is non-standard. Use builtin 'command -v' instead.
+
+# "warning" is the default severity level for shellcheck
diff --git a/validate.py b/validate.py
index bac8cbf..aa44eb1 100755
--- a/validate.py
+++ b/validate.py
@@ -221,7 +221,7 @@
return 0
-def validate_shell(filename, ignore_options):
+def validate_shell(filename, args):
ignore_string = ""
if args.shellcheck_ignore is not None:
# Exclude types of warnings in the following format:
@@ -229,6 +229,7 @@
ignore_string = "-e %s" % ",".join(args.shellcheck_ignore)
if len(ignore_string) < 4: # contains only "-e "
ignore_string = ""
+ ignore_string = "-S %s %s" % (args.shellcheck_level, ignore_string)
cmd = "shellcheck %s" % ignore_string
return validate_external(cmd, filename, "SHELLCHECK", args)
@@ -342,6 +343,14 @@
dest="shellcheck_ignore",
)
parser.add_argument(
+ "-l",
+ "--shellcheck-level",
+ default="warning",
+ help="Shellcheck level set with -S",
+ dest="shellcheck_level",
+ )
+
+ parser.add_argument(
"-g",
"--git-latest",
action="store_true",