Skip to content

Instantly share code, notes, and snippets.

@marcusramberg
Created October 31, 2023 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusramberg/892fb12e087af98a0e5a469662329220 to your computer and use it in GitHub Desktop.
Save marcusramberg/892fb12e087af98a0e5a469662329220 to your computer and use it in GitHub Desktop.
In nimbench.sh line 4:
[[ $V == CC=* ]] && export $V || { echo "Unknown parameter $V"; exit 1; }
^-- SC2015 (info): Note that A && B || C is not if-then-else. C may run when A is true.
^-- SC2163 (warning): This does not export 'V'. Remove $/${} for that, or use ${var?} to quiet.
^-- SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
[[ $V == CC=* ]] && export "$V" || { echo "Unknown parameter $V"; exit 1; }
In nimbench.sh line 9:
rm -rf $HOME/.cache/nim/{koch_d,nim_r,nimble_r,nimgrep_r,nimpretty_r,nimsuggest_r,testament_r}
^---^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
rm -rf "$HOME"/.cache/nim/{koch_d,nim_r,nimble_r,nimgrep_r,nimpretty_r,nimsuggest_r,testament_r}
In nimbench.sh line 13:
[[ $OS == "Linux" ]] && {
^-- SC2015 (info): Note that A && B || C is not if-then-else. C may run when A is true.
In nimbench.sh line 19:
echo "Disk:" `lsblk -n -d -o VENDOR,MODEL $(findmnt -n -f --target . | awk '{print $2}') | grep -v '^[[:space:]]*$' | head -n1`
^-- SC2046 (warning): Quote this to prevent word splitting.
^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
^-- SC2046 (warning): Quote this to prevent word splitting.
Did you mean:
echo "Disk:" $(lsblk -n -d -o VENDOR,MODEL $(findmnt -n -f --target . | awk '{print $2}') | grep -v '^[[:space:]]*$' | head -n1)
In nimbench.sh line 20:
echo "OS: $OS (`uname -r`)"
^--------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
echo "OS: $OS ($(uname -r))"
In nimbench.sh line 21:
echo 'Cc:' `$CC --version | head -n1`
^------------------------^ SC2046 (warning): Quote this to prevent word splitting.
^------------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
echo 'Cc:' $($CC --version | head -n1)
In nimbench.sh line 24:
echo 'CPU:' `sysctl -n machdep.cpu.brand_string`
^-- SC2046 (warning): Quote this to prevent word splitting.
^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
echo 'CPU:' $(sysctl -n machdep.cpu.brand_string)
In nimbench.sh line 25:
echo 'Cores:' `sysctl -n hw.ncpu`
^-----------------^ SC2046 (warning): Quote this to prevent word splitting.
^-----------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
echo 'Cores:' $(sysctl -n hw.ncpu)
In nimbench.sh line 26:
FREQ=`sysctl -n hw.cpufrequency`
^-------------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
FREQ=$(sysctl -n hw.cpufrequency)
In nimbench.sh line 27:
[[ -n $FREQ ]] && echo 'Freq:' $(($FREQ / 1000000))
^---^ SC2004 (style): $/${} is unnecessary on arithmetic variables.
In nimbench.sh line 28:
echo 'RAM:' `sysctl -n hw.physmem`
^--------------------^ SC2046 (warning): Quote this to prevent word splitting.
^--------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
echo 'RAM:' $(sysctl -n hw.physmem)
In nimbench.sh line 30:
echo "OS: $OS (`uname -r`)"
^--------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
echo "OS: $OS ($(uname -r))"
In nimbench.sh line 31:
echo 'Cc:' `$CC --version | head -n1`
^------------------------^ SC2046 (warning): Quote this to prevent word splitting.
^------------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
echo 'Cc:' $($CC --version | head -n1)
In nimbench.sh line 37:
echo Benching $@
^-- SC2068 (error): Double quote array expansions to avoid re-splitting elements.
In nimbench.sh line 39:
cd Nim && ( time $@ 2>&3 ) 3>&2 2>>../time.log
^-- SC2068 (error): Double quote array expansions to avoid re-splitting elements.
In nimbench.sh line 56:
grep -i microsoft /proc/version 2>/dev/null && { export BROWSER=wslview; } || false
^-- SC2015 (info): Note that A && B || C is not if-then-else. C may run when A is true.
In nimbench.sh line 57:
./Nim/bin/nim c --cc:$CC -r complete.nim
^-^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
./Nim/bin/nim c --cc:"$CC" -r complete.nim
In nimbench.sh line 69:
source ci/funs.sh && \
^--------^ SC1091 (info): Not following: ci/funs.sh was not specified as input (see shellcheck -x).
In nimbench.sh line 71:
echo_run git clone -q $nim_csourcesUrl "$nim_csourcesDir" && \
^--------------^ SC2154 (warning): nim_csourcesUrl is referenced but not assigned.
^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^--------------^ SC2154 (warning): nim_csourcesDir is referenced but not assigned.
Did you mean:
echo_run git clone -q "$nim_csourcesUrl" "$nim_csourcesDir" && \
In nimbench.sh line 72:
echo_run git -C "$nim_csourcesDir" checkout $nim_csourcesHash
^---------------^ SC2154 (warning): nim_csourcesHash is referenced but not assigned.
^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
echo_run git -C "$nim_csourcesDir" checkout "$nim_csourcesHash"
In nimbench.sh line 77:
sed 's/ --hints:off/ --hints:off --cc:$CC/g' Nim/build_all.sh > Nim/build_all.sh_tmp && \
^-- SC2016 (info): Expressions don't expand in single quotes, use double quotes for that.
In nimbench.sh line 79:
bench_cmd ./build_all.sh CC=$CC && \
^-^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
bench_cmd ./build_all.sh CC="$CC" && \
In nimbench.sh line 80:
bench_cmd ./koch temp -d:release --cc:$CC
^-^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
bench_cmd ./koch temp -d:release --cc:"$CC"
For more information:
https://www.shellcheck.net/wiki/SC2068 -- Double quote array expansions to ...
https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...
https://www.shellcheck.net/wiki/SC2154 -- nim_csourcesDir is referenced but...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment