STYLE: Make pre-commit run --all-files converge - #475
Merged
dzenanz merged 1 commit intoSep 2, 2026
Merged
Conversation
…ists src/External and src/GPU hold no examples yet, but src/CMakeLists.txt calls add_subdirectory() on both, so each needs a CMakeLists.txt. With those files empty, gersemi wrote a lone newline and end-of-file-fixer stripped it back, so `pre-commit run --all-files` never converged. Documenting why the files exist gives both hooks something to agree on. Also applies gersemi's pending reformat of ComputeCurvatureAnisotropicDiffusion/CMakeLists.txt.
hjmjohnson
marked this pull request as ready for review
September 2, 2026 14:00
dzenanz
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pre-commit run --all-fileshas never converged on this repo: two hooks disagree aboutsrc/External/CMakeLists.txtandsrc/GPU/CMakeLists.txt, each of which contains only a newline. Giving both files a comment explaining why they exist resolves it, and unblocks thegersemihook that has been unreachable since it was added.The deadlock
Both directories hold an
index.rstbut no examples yet, so theirCMakeLists.txtis empty.src/CMakeLists.txtstill callsadd_subdirectory(External)andadd_subdirectory(GPU), so the files cannot be deleted — CMake requires them.On a degenerate zero-content file the two hooks want opposite things:
gersemiend-of-file-fixerEach run flips the file back, so
--all-filesreports a failure forever. Any real content breaks the tie, and a comment is the useful kind of content.Verified locally: run 1 applies the changes, runs 2 and 3 are fully clean.
Second commit: why one file was drifted, and why the style matches ITK
gersemiwas onboarded in1f457f72(2026-06-16).ComputeCurvatureAnisotropicDiffusion/CMakeLists.txtlast changed inf5f72685(2026-06-12) — four days earlier, so it predates the hook.It stayed drifted because this config sets
fail_fast: trueandend-of-file-fixerruns beforegersemi. The deadlock above failed EOF on every run, sogersemihas never executed repo-wide since the day it was added. Fixing the empty files is what makes the formatter reachable; this reformat is the backlog that falls out.The reformat is not a new or local style. This repo and ITK
mainpin the samegersemi0.19.3 with the same.gersemi.config(indent 2,line_length80,list_expansion: favour-expansion). Checked against ITK's own config directly:Same result for the two commented
CMakeLists.txt. ITK's config additionally setsdefinitions: ["CMake/stubs"], which teaches gersemi about ITK-specific commands; this file uses onlyset,target_link_libraries,installandadd_test, which is why the check is a no-op regardless.Split out of #476 (ITK 6.0
LevelSetNodecontainer fix), which was blocked behind this gate.