From 804e8f94a63c46cdb202800c68ccfb3de2312f3e Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 13 Feb 2022 08:25:40 +0000 Subject: [PATCH] CI: prepare for enabling shellcheck warnings and info - Assume /bin/sh has dash's features and ignore corresponding false positives - Exclude parser/tst, tests and utils/test directories: they have tons of shellcheck violations but they don't *directly* impact our users. Let's first focus on code that runs on production systems. - Exclude rc.apparmor.slackware: I don't know anything about Slackware's /bin/sh. --- .shellcheckrc | 10 ++++++++++ tests/bin/shellcheck-tree | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .shellcheckrc diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 000000000..1dcfc1b86 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,10 @@ +# Don't follow source'd scripts +disable=SC1090 +disable=SC1091 + +# dash supports 'local' +disable=SC2039 +disable=SC3043 + +# dash supports 'echo -n' +disable=SC3037 diff --git a/tests/bin/shellcheck-tree b/tests/bin/shellcheck-tree index 7a5dab250..a439fcf14 100755 --- a/tests/bin/shellcheck-tree +++ b/tests/bin/shellcheck-tree @@ -8,8 +8,10 @@ from pathlib import Path def is_excluded(f): - return re.match(r"^([.]git)/", - f) or Path(f).is_dir() + return (re.match( + r"^([.]git/|parser/tst/|tests/|utils/test/|parser/rc[.]apparmor[.]slackware)", + f, + ) or Path(f).is_dir()) def mimetype(f):