Page MenuHomeDevCentral

D2977.diff
No OneTemporary

D2977.diff

diff --git a/pre-commit-hooks/shellcheck.sh b/pre-commit-hooks/shellcheck.sh
--- a/pre-commit-hooks/shellcheck.sh
+++ b/pre-commit-hooks/shellcheck.sh
@@ -16,6 +16,7 @@
exit_status=0
enable_list=""
+severity="style"
parse_arguments() {
while (($# > 0)); do
@@ -28,6 +29,9 @@
--enable)
enable_list="$enable_list $VALUE"
;;
+ --severity)
+ severity=$VALUE
+ ;;
-*)
echo "Error: Unknown option: $PARAMETER" >&2
exit 1
@@ -45,7 +49,7 @@
for FILE in $files; do
SHEBANG_REGEX='^#!\(/\|/.*/\|/.* \)\(\(ba\|da\|k\|a\)*sh\|bats\)$'
if (head -1 "$FILE" | grep "$SHEBANG_REGEX" >/dev/null); then
- if ! shellcheck ${enable_list:+ --enable="$enable_list"} "$FILE"; then
+ if ! shellcheck ${enable_list:+ --enable="$enable_list"} --severity="$severity" "$FILE"; then
exit_status=1
fi
elif [[ "$FILE" =~ .+\.(sh|bash|dash|ksh|ash|bats)$ ]]; then

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 01:28 (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2263661
Default Alt Text
D2977.diff (885 B)

Event Timeline