Merge pull request #2021 from xexyl/gson92-mkdict-sc

Silence 1992/gson/mkdict.sh shellcheck warnings
This commit is contained in:
Landon Curt Noll authored and GitHub committed 2024-01-23 12:05:33 -08:00
commit abd22d50cb
2 files changed
+33 -11

No files matched your search

+24 -2
View File
@@ -1,4 +1,26 @@
#!/usr/bin/env bash
#
# mkdict.sh - make a dictionary file for IOCCC winner 1992/gson
#
# This OBFUSCATED script was provided by the author.
#
# We disable all warnings from shellcheck(1) because this script was provided by
# the author as an OBFUSCATED SCRIPT and not one to follow best practices.
#
# SC2060 (warning): Quote parameters to tr to prevent glob expansion.
# https://www.shellcheck.net/wiki/SC2060 -- Quote parameters to tr to prevent...
# SC2248 (style): Prefer double quoting even when variables don't contain special characters.
# https://www.shellcheck.net/wiki/SC2248
# SC1001 (info): This \^ will be a regular '^' in this context.
# https://www.shellcheck.net/wiki/SC1001 -- This \^ will be a regular '^' in ...
# SC1087 (error): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet).
# https://www.shellcheck.net/wiki/SC1087 -- Use braces when expanding arrays,...
# SC2248 (style): Prefer double quoting even when variables don't contain special characters.
# https://www.shellcheck.net/wiki/SC2248
# SC1001 (info): This \^ will be a regular '^' in this context.
# https://www.shellcheck.net/wiki/SC1001 -- This \^ will be a regular '^' in ...
# SC2248 (style): Prefer double quoting even when variables don't contain special characters.
# https://www.shellcheck.net/wiki/SC2248
# shellcheck disable=SC2060,SC2248,SC1001,SC1087
z=a-z];tr [A-Z\] \[$z|sed s/[\^$z[\^$z*/_/g|tr _ \\012|grep ..|sort -u
+9 -9
View File
@@ -45,13 +45,13 @@ fi
#
# Requires bash with a version 4.2 or later
#
shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded
shopt -s nullglob # enable expand to nothing rather than remaining unexpanded
shopt -u failglob # disable error message if no matches are found
shopt -u dotglob # disable matching files starting with .
shopt -s globskipdots # enable never matching . nor ..
shopt -u dotglob # disable matching files starting with '.'
shopt -s globskipdots # enable never matching '.' nor '..'
shopt -u nocaseglob # disable strict case matching
shopt -u extglob # enable extended globbing patterns
shopt -s globstar # enable ** to match all files and zero or more directories and subdirectories
shopt -s globstar # enable '**' to match all files and zero or more directories and subdirectories
# set variables referenced in the usage message
#
@@ -62,7 +62,7 @@ export V_FLAG=0
GIT_TOOL=$(type -P git)
export GIT_TOOL
if [[ -z "$GIT_TOOL" ]]; then
echo "$0: FATAL: git tool is not installed or not in PATH" 1>&2
echo "$0: FATAL: git tool is not installed or is not in PATH" 1>&2
exit 200
fi
"$GIT_TOOL" rev-parse --is-inside-work-tree >/dev/null 2>&1
@@ -238,7 +238,7 @@ if [[ ! -d $INC_PATH ]]; then
fi
export INC_DIR="inc"
# verify that we have an bin subdirectory
# verify that we have a bin subdirectory
#
export BIN_PATH="$TOPDIR/bin"
if [[ ! -d $BIN_PATH ]]; then
@@ -333,7 +333,7 @@ if [[ ! -e $WINNER_JSON ]]; then
exit 5
fi
if [[ ! -f $WINNER_JSON ]]; then
echo "$0: ERROR: .winner.json is not a file: $WINNER_JSON" 1>&2
echo "$0: ERROR: .winner.json is not a regular file: $WINNER_JSON" 1>&2
exit 5
fi
if [[ ! -r $WINNER_JSON ]]; then
@@ -345,7 +345,7 @@ if [[ ! -e $PANDOC_WRAPPER ]]; then
exit 6
fi
if [[ ! -f $PANDOC_WRAPPER ]]; then
echo "$0: ERROR: pandoc wrapper tool is not a file: $PANDOC_WRAPPER" 1>&2
echo "$0: ERROR: pandoc wrapper tool is not a regular file: $PANDOC_WRAPPER" 1>&2
exit 6
fi
if [[ ! -x $PANDOC_WRAPPER ]]; then
@@ -361,7 +361,7 @@ if [[ ! -e $MANIFEST_WINNER_JSON_AWK ]]; then
exit 6
fi
if [[ ! -f $MANIFEST_WINNER_JSON_AWK ]]; then
echo "$0: ERROR: bin/manifest.winner.json.awk is not a file: $MANIFEST_WINNER_JSON_AWK" 1>&2
echo "$0: ERROR: bin/manifest.winner.json.awk is not a regular file: $MANIFEST_WINNER_JSON_AWK" 1>&2
exit 6
fi
if [[ ! -r $MANIFEST_WINNER_JSON_AWK ]]; then