COMP: Enable pre-commit-hooks safety nets on release-5.4 - #6840
Conversation
The comment referenced blob/master, whose line numbers drift as the branch advances. Point it at the commit that last touched the file.
The file carries a shebang but not the executable bit. Only the mode changes; the content is untouched.
Files without a terminating newline, as reported by the end-of-file-fixer hook.
Lines with trailing whitespace, as reported by the trailing-whitespace hook.
Replace the empty repos list with the pre-commit-hooks block from main, byte-identical at rev v5.0.0, so backported commits meet the same repository checks on both branches. Formatter hooks are deliberately excluded: clang-format, gersemi, black and the spell checker would reformat the branch rather than guard it. The 21 hooks added here are repository safety nets only, and the preceding commits clear the violations they report, so this change is a no-op against the current tree.
|
|
The two P2 greptile findings will be addressed in a set of followup PRs against main and release-5.4 |
6e1fc53
into
InsightSoftwareConsortium:release-5.4
Enables the
pre-commit-hookssafety nets onrelease-5.4, byte-identical tomainat revv5.0.0. Follow-up to #6837, implementing #6837 (comment).The first four commits clear the violations these hooks report, one class per commit, so the final commit that turns them on is a no-op against the tree. Formatter hooks — clang-format, gersemi, black, spell check — are deliberately not included: those reformat the branch rather than guard it.
Commits
STYLE: Pin a GitHub link…blob/master/…→ a commit SHA (check-vcs-permalinks)STYLE: Mark VCL_ModernizeNaming.py executable…check-shebang-scripts-are-executable)STYLE: Add missing end-of-file newlinesend-of-file-fixer)STYLE: Remove trailing whitespacetrailing-whitespace)COMP: Enable the pre-commit-hooks safety nets….pre-commit-config.yamlonlyNo source file that ITK formats is touched: every changed file is
hooks.style: unspecifiedexcept oneCMakeLists.txt(cmakeformat), and zero files carry theclangformatattribute — verified withgit check-attr.clang-format.bash --trackedselects onlyclangformatfiles, so the lint job has nothing to act on here.Verification
All 21 hooks pass against the final tree:
The four skips are "no files to check" on this branch, not failures.
Before these fixes, four hooks failed:
check-vcs-permalinks,check-shebang-scripts-are-executable,end-of-file-fixer, andtrailing-whitespace. The other 17 passed unmodified —release-5.4was already clean against them.Note on the shebang commit
Utilities/Maintenance/VCL_ModernizeNaming.pystarts with#!python, the Windows py-launcher form. Only the file mode changes; the content is untouched. If the preference is to drop the shebang instead, say so and I will swap that commit.