Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shellcheck and pre-commit to CI jobs #3002

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bf588a2
add shellcheck and pre-commit to CI jobs
terhorstd Nov 21, 2023
bb00bbf
Merge remote-tracking branch 'upstream/master' into add-shellcheck-pr…
terhorstd Jan 21, 2025
aed74c6
enable checking more file formatting issues
terhorstd Jan 21, 2025
6e0e5c4
reformatted whitespaces and newlines
terhorstd Jan 21, 2025
ac35773
fixed numerous quotes and plain bugs found by shellcheck
terhorstd Jan 21, 2025
d9e7231
add shellcheck, pre-commit-hooks and cppcheck as build prerequisites
terhorstd Jan 21, 2025
12d79b4
add CI check for Windows line endings CRLF
terhorstd Jan 21, 2025
8fddc68
fix run_examples search mechanism
terhorstd Jan 21, 2025
42765f6
attempt to fix missing shellcheck input file
terhorstd Jan 21, 2025
6f1b088
fix return code of check_forbidden_types.sh
terhorstd Jan 21, 2025
6678863
try argument with koalaman/shellcheck-precommit
terhorstd Jan 21, 2025
9286262
notice incoherent shellcheck file lists
terhorstd Jan 21, 2025
24d4a39
fix typo
terhorstd Jan 22, 2025
26456a7
fix undefined variable in junit_xml.sh
terhorstd Jan 22, 2025
ff38aad
partial pre-commit autoupdate
terhorstd Jan 22, 2025
a69ce17
improved comment
terhorstd Jan 22, 2025
f7e9464
add workaround for missing 'find -printf' on MacOS
terhorstd Jan 22, 2025
4ea5f00
added extra explanation for future me
terhorstd Jan 22, 2025
9571b05
Fix typo in comment
heplesser Jan 22, 2025
cd2484c
more fixes of shell quoting and escaping for install scripts
terhorstd Jan 30, 2025
a8fa1a9
Merge remote-tracking branch 'refs/remotes/origin/add-shellcheck-prec…
terhorstd Jan 30, 2025
efdf4c8
Merge remote-tracking branch 'upstream/master' into add-shellcheck-pr…
terhorstd Jan 30, 2025
6f937eb
change quoting and reporting of library install paths
terhorstd Jan 30, 2025
b9025f7
change hardcoded gtime path on Darwin to $(which …)
terhorstd Feb 26, 2025
ec854ca
Merge branch 'master' into add-shellcheck-precommit
terhorstd Feb 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix return code of check_forbidden_types.sh
  • Loading branch information
terhorstd committed Jan 21, 2025
commit 6f1b08853308b81132900dca4cc66dff75aea91d
8 changes: 6 additions & 2 deletions build_support/check_forbidden_types.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ set -euo pipefail

forbidden_types="double_t"
used_forbidden_types=""
NEST_SOURCE="${NEST_SOURCE:-.}"

for t in $forbidden_types; do
scan_result="$(grep "$t" -r -o --include=*.{h,cc,cpp} "$NEST_SOURCE" | sed 's/:/: /')"
scan_result="$(grep "$t" -rHn -o --include=*.{h,cc,cpp} "$NEST_SOURCE" || true)"
if [ -n "$scan_result" ]; then
used_forbidden_types="$used_forbidden_types$'\n'$scan_result"
fi
done

echo "$used_forbidden_types"
test -z "$used_forbidden_types" || { # return success if no forbidden types where used or print the corresponding list and error out
echo "$used_forbidden_types"
exit 1
}