Skip to content

Format patch files + check for EOL whitespace in ci - #779

Merged
kmontemayor2-sc merged 4 commits into
mainfrom
kmonte/format-glt-patches
Sep 29, 2026
Merged

kmontemayor2-sc merged 4 commits into
mainfrom
kmonte/format-glt-patches

Conversation

@kmontemayor2-sc

Copy link
Copy Markdown
Collaborator

This wasn't done before, we should do it

kmonte and others added 3 commits September 28, 2026 18:20
The two GLT patches carried a single space on each blank context line.
The whitespace pre-commit hooks run at pre-push as well, so any push whose
range contained those files failed and left rewritten patches in the
working tree. CI never ran these hooks, so nothing caught it before a push.

GNU patch reads an empty line in a hunk as a blank context line. Applied
with `patch -p1 --forward` (as install_glt.sh does) to GLT at 88ff111a,
the stripped patches apply without fuzz and produce a tree byte-identical
to the one the original patches produce.

check_format now runs end-of-file-fixer and trailing-whitespace over all
tracked files, so `make lint_test` fails on these errors in CI. On main
the two patches were the only files either hook flagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The whitespace hooks have no check-only mode, so separate check and
format targets ran the same command under two names. format and
check_format now both depend on format_whitespace.

Both hooks now always run. Before, a fix by end-of-file-fixer exited
non-zero and make skipped trailing-whitespace, so one run did not fix
everything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
format_whitespace called the two hooks separately and combined their
exit codes by hand, because a second recipe line does not run after the
first one fails. Both hooks now carry `alias: whitespace`, and one
`pre-commit run whitespace` selects them together. pre-commit runs every
selected hook even after one fails, since fail_fast defaults to false.

The alias changes no stages, so the commit and push hooks are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@mkolodner-sc mkolodner-sc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Kyle!

@kmontemayor2-sc
kmontemayor2-sc marked this pull request as ready for review September 28, 2026 23:19
@kmontemayor2-sc
kmontemayor2-sc added this pull request to the merge queue Sep 28, 2026
Merged via the queue into main with commit 620b693 Sep 29, 2026
7 checks passed
@kmontemayor2-sc
kmontemayor2-sc deleted the kmonte/format-glt-patches branch September 29, 2026 01:00
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.

4 participants