devtools: Add EOF fixer and trailing whitespace fix to pre-commit.
What changed, and why it matters
This commit only adds two cosmetic code-style checks to the project's pre-commit tooling: one that removes trailing whitespace and one that ensures files end with a newline. It does not change any production code, cryptographic logic, network handling, or user-facing behavior. There is no security relevance.
No security action needed. Treat as a routine developer-experience / linting change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff extends .pre-commit-config.yaml to enable pre-commit-hooks’ trailing-whitespace and end-of-file-fixer hooks, with exclusions for ccan, contrib, and tests/fuzz/corpora. No source code, build scripts, dependencies, or configuration with security implications were modified.
Changed components
.pre-commit-config.yamlInspect captured patch +5 / −0
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 31d99aee..16b52dd3 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -40,6 +40,11 @@ repos:
args: [ "--indent", "2", "--no-sort-keys" ]
files: ^doc/schemas/.*\.json$
types: [ json ]
+ - id: trailing-whitespace
+ args: [ "--markdown-linebreak-ext=md" ]
+ exclude: ccan|contrib|tests/fuzz/corpora
+ - id: end-of-file-fixer
+ exclude: ccan|contrib|tests/fuzz/corpora
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.