@@ -13,8 +13,6 @@ ROOT="$(realpath "$(dirname "$0")"/../)"
1313# Standard color definitions
1414GREEN=" \033[32m"
1515RED=" \033[31m"
16- BLUE=" \033[94m"
17- BOLD=" \033[1m"
1816NORMAL=" \033[0m"
1917
2018# utility
@@ -29,15 +27,15 @@ error()
2927}
3028
3129info " Formatting nix files"
32- if ! command -v nixpkgs-fmt 2>&1 > /dev/null; then
30+ if ! command -v nixpkgs-fmt > /dev/null 2>&1 ; then
3331 error " nixpkgs-fmt not found. Are you running in a nix shell? See BUILDING.md."
3432 exit 1
3533fi
3634
3735nixpkgs-fmt " $ROOT "
3836
3937info " Formatting shell scripts"
40- if ! command -v shfmt 2>&1 > /dev/null; then
38+ if ! command -v shfmt > /dev/null 2>&1 ; then
4139 error " shfmt not found. Are you running in a nix shell? See BUILDING.md."
4240 exit 1
4341fi
@@ -48,21 +46,21 @@ SHELL_SCRIPTS=$(echo "$ALL_FILES" | xargs shfmt -f)
4846shfmt -s -l -i 2 -ci -fn $SHELL_SCRIPTS
4947
5048info " Formatting python scripts"
51- if ! command -v black 2>&1 > /dev/null; then
49+ if ! command -v black > /dev/null 2>&1 ; then
5250 error " black not found. Are you running in a nix shell? See BUILDING.md."
5351 exit 1
5452fi
5553black --include " (scripts/tests|scripts/simpasm|scripts/cfify|scripts/autogen|scripts/check-namespace|\.py$)" " $ROOT "
5654
5755info " Formatting c files"
58- if ! command -v clang-format 2>&1 > /dev/null; then
56+ if ! command -v clang-format > /dev/null 2>&1 ; then
5957 error " clang-format not found. Are you running in a nix shell? See BUILDING.md."
6058 exit 1
6159fi
6260
6361nproc=$( getconf _NPROCESSORS_ONLN || echo 1)
6462
65- git ls-files -- " :/*.c" " :/*.h" | xargs -P $nproc -I {} sh -c '
63+ git ls-files -- " :/*.c" " :/*.h" | xargs -P " $nproc " -I {} sh -c '
6664 # Ignore symlinks
6765 if [[ ! -L {} ]]; then
6866 clang-format -i {}
@@ -71,7 +69,7 @@ git ls-files -- ":/*.c" ":/*.h" | xargs -P $nproc -I {} sh -c '
7169info " Checking for eol"
7270check-eol ()
7371{
74- git ls-files -- " :/" " :/!:*.png" | xargs -P $nproc -I {} sh -c '
72+ git ls-files -- " :/" " :/!:*.png" | xargs -P " $nproc " -I {} sh -c '
7573 # Ignore symlinks
7674 if [[ ! -L {} && $(tail -c1 "{}" | wc -l) == 0 ]]; then
7775 echo "" >>"{}"
0 commit comments