From 47b71185fcca81f926725a4e7ea24847a33fa93e Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 23 Jan 2024 05:42:03 -0800 Subject: [PATCH] Silence 1992/gson/mkdict.sh shellcheck warnings As a test of the new format of disabling warnings/errors from shellcheck(1) I have done it for this script which is an important one to consider as every warning and error should be disabled as the author provided the script (that I added as a script file) as an obfuscated script and therefore to not follow best practices, not at the time or now. But this way it's just one script to see if this works well, rather than fixing all the others (which will happen later in any case). --- 1992/gson/mkdict.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/1992/gson/mkdict.sh b/1992/gson/mkdict.sh index bf3b5b6ff..379e0ac5b 100755 --- a/1992/gson/mkdict.sh +++ b/1992/gson/mkdict.sh @@ -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 - -