Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion scripts/setup/git-hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ for tool in git python3 curl install mktemp; do
done
revision=632eff5452fe5c828bc0fb0224c992534567c776
checker_sha256=56561f64c2054899da968d96f0676e4ae10a00f72e3920f0f69cb5e594cf8af5
hook_sha256=ef024b5c725de166cbb64e7894d57b60e164443c92cfa315c14b0f74dce28e4a
hook_sha256=effe43885a5f5b4fe67d3bfe15de208406552e60facaf35f8aa3c145f19b7b10
dest="$HOME/.local/share/git-hooks"
if [[ "${1:-}" == --dry-run ]]; then
printf 'Would install global repository hygiene %s at %s\n' "$revision" "$dest"
Expand Down
6 changes: 5 additions & 1 deletion scripts/setup/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ elif git cat-file -e :CMakeLists.txt 2>/dev/null; then
fortran=true
fi
fi
if $fortran; then
# A subproject that only builds inside its superbuild (SIESTA in Stellarator-Tools)
# cannot pass a standalone build check; such checkouts opt out.
if $fortran && [[ "$(git config --bool hooks.foCheck || true)" == false ]]; then
echo 'hooks.foCheck=false: fo build/test pre-commit checks skipped' >&2
elif $fortran; then
if ! command -v fo >/dev/null; then
echo 'fo not found: build/test pre-commit checks skipped; install: https://github.com/lazy-fortran/fo' >&2
elif ! fo hook --help 2>/dev/null | grep -q 'fo hook pre-commit'; then
Expand Down