From deae3d100a9a077fce7d40b5c8039ca08d80d5bb Mon Sep 17 00:00:00 2001
From: Grische <github@grische.xyz>
Date: Mon, 1 Jul 2024 22:07:30 +0200
Subject: [PATCH] scripts: remove scripts-wide shellcheck excludes

This removes script-wide shellcheck excludes to avoid unintentional
errors and moves the excludes to the scripts where they are necessary.
---
 scripts/default_feeds.sh | 3 +++
 scripts/lint-sh.sh       | 2 +-
 scripts/module_check.sh  | 1 +
 scripts/modules.sh       | 4 ++++
 scripts/sha256sum.sh     | 1 +
 scripts/update.sh        | 1 +
 6 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/scripts/default_feeds.sh b/scripts/default_feeds.sh
index 0806539ac..637ed26b4 100644
--- a/scripts/default_feeds.sh
+++ b/scripts/default_feeds.sh
@@ -1,2 +1,5 @@
+#!/bin/sh
+
 # list feeds which don't start with #
 DEFAULT_FEEDS="$(awk '!/^#/ {print $2}' openwrt/feeds.conf.default)"
+export DEFAULT_FEEDS
diff --git a/scripts/lint-sh.sh b/scripts/lint-sh.sh
index 96335c7aa..93b3d09a4 100755
--- a/scripts/lint-sh.sh
+++ b/scripts/lint-sh.sh
@@ -24,5 +24,5 @@ find scripts -type f | while read -r file; do
 	is_scriptfile "$file" || continue
 
 	echo "Checking $file"
-	shellcheck -f gcc -x -e SC2154,SC1090,SC2181,SC2155,SC2148,SC2034,SC2148 "$file"
+	shellcheck -f gcc -x "$file"
 done
diff --git a/scripts/module_check.sh b/scripts/module_check.sh
index 76e0e56af..977398a2c 100755
--- a/scripts/module_check.sh
+++ b/scripts/module_check.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+# shellcheck disable=SC2154
 
 set -e
 
diff --git a/scripts/modules.sh b/scripts/modules.sh
index d28d845aa..3d2df8495 100644
--- a/scripts/modules.sh
+++ b/scripts/modules.sh
@@ -1,4 +1,8 @@
+#!/bin/sh
+
+# shellcheck source=./modules
 . ./modules
+
 [ ! -f "$GLUON_SITEDIR"/modules ] || . "$GLUON_SITEDIR"/modules
 
 # shellcheck disable=SC2086
diff --git a/scripts/sha256sum.sh b/scripts/sha256sum.sh
index 99d97acd0..546634174 100755
--- a/scripts/sha256sum.sh
+++ b/scripts/sha256sum.sh
@@ -15,6 +15,7 @@ else
 	exit 1
 fi
 
+# shellcheck disable=SC2181
 [ "$?" -eq 0 ] || exit 1
 
 echo "$ret" | awk '{ print $1 }'
diff --git a/scripts/update.sh b/scripts/update.sh
index a9f28b05f..b6c0565e7 100755
--- a/scripts/update.sh
+++ b/scripts/update.sh
@@ -1,4 +1,5 @@
 #!/bin/bash
+# shellcheck disable=SC2154
 
 set -e
 
-- 
GitLab