[ci, tools] shellcheck-ed #397
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "DraVee:old/shellcheck"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
update-icons.sh/source.sh now checks for dependencies the correct way
add --help to license-header.sh
nuke
tools/reset-submodules
and any ref on ci/toolsadd missing shebang to .ci/windows/package.sh
all script tools on root of
./ci
are now POSIX-compliantBelow the error/warnings/infos from shellcheck:
-- SC2068 (error): Double quote array expansions to avoid re-splitting elements.
-- SC3054 (warning): In POSIX sh, array references are undefined.
-- SC2155 (warning): Declare and assign separately to avoid masking return values.
-- SC2046 (warning): Quote this to prevent word splitting.
-- SC2236 (style): Use -n instead of ! -z.
-- SC2006 (style): Use $(...) notation instead of legacy backticks
...
.-- SC2001 (style): See if you can use ${variable//search/replace} instead.
-- SC2086 (info): Double quote to prevent globbing and word splitting.
-- SC2185 (info): Some finds don't have a default path. Specify '.' explicitly.
Signed-off-by: Caio Oliveira caiooliveirafarias0@gmail.com
@ -16,0 +39,4 @@
exit 0
fi
RANGE="$(echo "$COMMITS" | tail -n1)^..$(echo "$COMMITS" | head -n1)"
FILES=$(git diff-tree --no-commit-id --name-only "${RANGE}" -r)
Let's just change this to use two commands. There's another PR open that has it I think
I'm gonna search for this PR later (power outage)
It's on #296, gonna check the difference later
@ -6,3 +9,3 @@
# requires fd
SOURCES=`fd . src/yuzu -tf -e ui -e cpp -e h -e plist`
SOURCES=$(fd . src/yuzu -tf -e ui -e cpp -e h -e plist)
Might be worth converting to POSIX find, I made this script in 5 seconds and was too lazy to fix
This one is just style fix
find src/yuzu -type f \( -name '*.ui' -o -name '*.cpp' -o -name '*.h' -o -name '*.plist' \)
Will change it later
In general, we need to move the CI scripts from the workflow repo. I already did this with windows in #348
@crueter wrote in #397 (comment):
I'm planning to do it, but first I want to see if (#349) didn't break compilation on windows
d4e000fc48
to671b17ecb4
584e8419e7
to3428fe4716
This supersede #349 and make all other scripts on
./ci
POSIX-compliant@Lizzie could you check this on BSD?
@DraVee wrote in #397 (comment):
applies it to every file now...
@Lizzie wrote in #397 (comment):
sorry, I didn't understand
@DraVee wrote in #397 (comment):
It now changes EVERY file instead of just the changed ones
@Lizzie I will need to install BSD to see what's broken, but this should fix (i think?)
If we go with grep instead let's also add shell scripts to the cmake check
use .sh and .ps1
194eae51e6
todfb11f1532
dfb11f1532
tob379c73583
b379c73583
to51a5ed1697
51a5ed1697
to6bbc8e7885
@crueter should be done now, basically rewrite the entire thing
6bbc8e7885
to3f90405749
@ -23,0 +47,4 @@
COMMENT_TYPE="$1"
FILE="$2"
HEADER_LINE1=$(printf '%s\n' "$HEADER_LINE1_TEMPLATE" | sed "s|{COMMENT_TEMPLATE}|$COMMENT_TYPE|g")
This is kind of a mess, I'll look at it later when on pc
Well I couldn't think of another way to make it search for the multi-line, and variable substitution is not supported on sh only on bash, so I used this mess
First, it's probably better to just prepend the comment type instead of templating.
Second, if we head -n5 the content, then we can
grep -A1 -e "$HEADER_LINE1" "$HEAD" | grep -B1 "$HEADER_LINE2"
which should be a nearly instantaneous and much cleaner.After searching, the commands
-A
and-B
are GNU extensions, I will look into it later (probably will use awk)4e05da5998
to2f0c9eb9ba
2f0c9eb9ba
to51f58c695f
51f58c695f
toe8d03a13e7
Gonna open a new PR just to changes on license-header.sh
Pull request closed