Format patch files + check for EOL whitespace in ci - #779
Merged
Merged
Conversation
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>
yliu2-sc
approved these changes
Sep 28, 2026
kmontemayor2-sc
marked this pull request as ready for review
September 28, 2026 23:19
kmontemayor2-sc
requested review from
svij-sc,
xgao4-sc and
zfan3-sc
as code owners
September 28, 2026 23:19
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.
This wasn't done before, we should do it