Skip to content

Let a checkout opt out of the fo build check - #90

Merged
krystophny merged 2 commits into
mainfrom
hook-fo-optout
Nov 10, 2026
Merged

krystophny merged 2 commits into
mainfrom
hook-fo-optout

Conversation

@krystophny

Copy link
Copy Markdown
Member

The hook runs fo hook pre-commit on every checkout with Fortran sources and a top-level CMakeLists.txt. SIESTA's repository is such a checkout but configures only inside the Stellarator-Tools superbuild (its CMakeLists.txt depends on the superbuild target pull_siesta), so every commit there fails:

CMake Error at CMakeLists.txt:6 (add_dependencies):
  The dependency target "pull_siesta" of target "siesta" does not exist.

scripts/setup/pre-commit now skips the fo check when the checkout sets git config hooks.foCheck false, as hooks.repoPreCommit=false already does for repository pre-commit configurations; the hygiene and secret checks still run. git-hooks.sh gets the new hook_sha256.

The global hook test in the prompts repository gains a case: a Fortran CMake project that cannot configure blocks a commit, and commits after the opt-out. It fails with the previous hook and passes with this one.

Chris&AI

A Fortran subproject that configures only inside its superbuild (SIESTA in
Stellarator-Tools) cannot pass a standalone build; hooks.foCheck=false skips
fo for that checkout, like hooks.repoPreCommit for repository configs.
@krystophny
krystophny added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 1b026b3 Nov 10, 2026
2 checks passed
@krystophny
krystophny deleted the hook-fo-optout branch November 10, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant