2020# Standard color definitions
2121GREEN=" \033[32m"
2222RED=" \033[31m"
23- BLUE=" \033[94m"
24- BOLD=" \033[1m"
2523NORMAL=" \033[0m"
2624
2725info ()
151149gh_group_end
152150
153151gh_group_start " Linting c files with clang-format"
154- checkerr " Lint C" " $( clang-format $( git ls-files " :/*.c" " :/*.h" ) --Werror --dry-run 2>&1 | grep " error:" | cut -d ' :' -f 1,2 | tr ' :' ' ' ) "
152+ checkerr " Lint C" " $( clang-format " $( git ls-files " :/*.c" " :/*.h" ) " --Werror --dry-run 2>&1 | grep " error:" | cut -d ' :' -f 1,2 | tr ' :' ' ' ) "
155153gh_group_end
156154
157155check-eol-dry-run ()
@@ -173,22 +171,22 @@ check-spdx()
173171 local success=true
174172 for file in $( git ls-files -- " :/" " :/!:*.json" " :/!:*.png" " :/!:*LICENSE*" " :/!:.git*" " :/!:flake.lock" ) ; do
175173 # Ignore symlinks
176- if [[ ! -L $file && $( grep " SPDX-License-Identifier:" $file | wc -l) == 0 ]]; then
174+ if [[ ! -L $file && $( grep " SPDX-License-Identifier:" " $file " | wc -l) == 0 ]]; then
177175 gh_error " $file " " ${line:- 1} " " Missing license header error" " $file is missing SPDX License header"
178176 success=false
179177 fi
180178 done
181179 for file in $( git ls-files -- " *.[chsS]" " *.py" " *.mk" " *.yml" " **/Makefile*" " :/!proofs/cbmc/*.py" " :/!examples/bring_your_own_fips202/custom_fips202/tiny_sha3/*" ) ; do
182180 # Ignore symlinks
183- if [[ ! -L $file && $( grep " Copyright (c) The mldsa-native project authors" $file | wc -l) == 0 ]]; then
181+ if [[ ! -L $file && $( grep " Copyright (c) The mldsa-native project authors" " $file " | wc -l) == 0 ]]; then
184182 gh_error " $file " " ${line:- 1} " " Missing copyright header error" " $file is missing copyright header"
185183 success=false
186184 fi
187185 done
188186 # For source files in dev/* and mldsa/*, we enforce `Apache-2.0 OR ISC OR MIT`
189187 for file in $( git ls-files -- " *.[chsSi]" | grep " ^dev/\|^mldsa/" ) ; do
190188 # Ignore symlinks
191- if [[ ! -L $file && $( grep " SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT" $file | wc -l) == 0 ]]; then
189+ if [[ ! -L $file && $( grep " SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT" " $file " | wc -l) == 0 ]]; then
192190 gh_error " $file " " ${line:- 1} " " Missing license header error" " $file is not licensed under 'Apache-2.0 OR ISC OR MIT'"
193191 success=false
194192 fi
@@ -209,7 +207,7 @@ gh_group_end
209207
210208check-autogenerated-files ()
211209{
212- if python3 $ROOT /scripts/autogen --dry-run; then
210+ if python3 " $ROOT " /scripts/autogen --dry-run; then
213211 info " Check native auto-generated files"
214212 gh_summary_success " Check native auto-generated files"
215213 else
@@ -225,7 +223,7 @@ gh_group_end
225223
226224check-magic ()
227225{
228- if python3 $ROOT /scripts/check-magic > /dev/null; then
226+ if python3 " $ROOT " /scripts/check-magic > /dev/null; then
229227 info " Check magic constants"
230228 gh_summary_success " Check magic constants"
231229 else
245243
246244check-contracts ()
247245{
248- if python3 $ROOT /scripts/check-contracts > /dev/null; then
246+ if python3 " $ROOT " /scripts/check-contracts > /dev/null; then
249247 info " Check contracts"
250248 gh_summary_success " Check contracts"
251249 else
0 commit comments