Repository navigation
Repo - MINOR - Format the repository and run the pre-commit check on every pull request - #356
Conversation
|
@matt-pharr assign someone or mark as draft |
logan-nc
left a comment
There was a problem hiding this comment.
Measured what this gate would see today, since nobody had posted the size of the sweep it waits for. JuliaFormatter.format(".") at v1.0.62 (the rev pinned in .pre-commit-config.yaml, so the gate and a local run agree) on develop db90e82 rewrites 88 files, +1212/−1064, spread over every module; the hygiene hooks additionally flag trailing whitespace in seven text files (.github/workflows/test.yaml and six benchmarks/*.jl). So the gate as written would fail every PR until that sweep lands, as the comment in the diff says. Sequencing suggestion: the sweep collides with #569 (36 files), #574 (39), #581 (35), #551 (31) and #593 (17), so the cheap order is those five first, then the one-off sweep, then this PR the same day. The diff itself is fine; one nit: format.yaml has no concurrency block while #593 adds cancel-in-progress to test.yaml, so a rapid push sequence will queue formatter runs.
|
closes #515 |
|
@matt-pharr Adding the one-off |
Output of `pre-commit run --all-files` with JuliaFormatter 1.0.62 (the version .pre-commit-config.yaml and the format workflow pin) on develop at 961484b: Julia formatting, trailing whitespace and end-of-file fixes. Nothing else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdRsGGg4YRG6E9fgLGbpdF
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdRsGGg4YRG6E9fgLGbpdF
…n it on pushes to develop Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdRsGGg4YRG6E9fgLGbpdF
…be the pre-commit CI check An unpinned Pkg.add installs JuliaFormatter 2.x, which formats differently and would fail the check on every contributor's first PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdRsGGg4YRG6E9fgLGbpdF
logan-nc
left a comment
There was a problem hiding this comment.
Review of the sweep and the CI change. No changes requested. Everything I found is already pushed to this branch.
The sweep (9e57323f9) is reproducible. Re-running pre-commit run --all-files (JuliaFormatter 1.0.62) on develop 961484b92 in a fresh worktree reproduces it byte for byte. The only difference is this PR's workflow file, which isn't on develop.
It's layout only.
- The only change inside string literals is five one-line docstrings turned into
"""blocks, with the same text. - No string macros or quoted code were touched, and no
[a -b]-style matrix literal changed meaning. - The seven coil-geometry
.datfiles only lose trailing spaces, andread_coil_datsplits on whitespace. Project.tomlonly loses two trailing blank lines.
CI: all green except the harness stamp. pre-commit, Tests, Documentation (so the reformatted docstrings render) and both Julia versions pass.
Fixed on this branch:
docs/src/set_up.mdtold contributors to runPkg.add("JuliaFormatter")without a version. That installs 2.x, which would fail this check on everyone's first PR. It now pins 1.0.62.CLAUDE.mdsaid the formatter version "is not currently pinned"; it now describes the pinned version and the check.- The workflow comment said the check was "expected to fail until the sweep lands"; corrected.
- Added a
pushtrigger ondevelop, so two clean PRs that merge into unformatted code are still caught.
Pending: the harness run, develop vs this branch (feynman job 137273, ETA about 23:30 EST). It should be bit-identical, and I'll add the stamp to the release note when it finishes. The "Title and release note" check is failing only because that stamp is missing.
When merging: add it to the queue, which uses merge commits, so the .git-blame-ignore-revs hash stays valid. Merge it before #625, #626 and #627; they already contain this sweep.
Release note
gal_resistive_peis N/A by designpre-commit run --all-filesbefore pushing. The pre-commit check now runs on every pull request intodevelopandmain. To bring an open branch in line, see the notes below.The repository is formatted with the pinned pre-commit hooks, and the pre-commit workflow runs on every pull request, so formatting churn stops showing up in PR diffs. Closes #515.
What changed
.github/workflows/format.yamladds thepull_requesttrigger fordevelopandmain.9e57323f9pre-commit run --all-fileson develop at961484b92, and nothing else. JuliaFormatter 1.0.62 is the version.pre-commit-config.yamland the workflow pin. 99 files change: Julia formatting, trailing whitespace, and end-of-file fixes (including seven coil-geometry.datfiles andProject.toml). Every TOML convention check already passed.ee76864c6develop, because two pull requests that are each clean can merge into unformatted code.f7fe63ce8docs/src/set_up.mdpins JuliaFormatter 1.0.62. The unpinnedPkg.add("JuliaFormatter")it used to suggest installs 2.x, which formats differently and would fail this check on a contributor's first PR.CLAUDE.md's formatting section now describes the pinned version and the CI check.1883beeb0.git-blame-ignore-revslists the sweep commit, so GitHub's blame skips it. Locally, rungit config blame.ignoreRevsFile .git-blame-ignore-revs.How to review the sweep
The sweep commit is reproducible: regenerating it from
961484b92in a fresh worktree reproduces it byte for byte. To check:.datfiles: they only lose trailing spaces, andread_coil_datsplits on whitespace, so they read the same.Bringing an open branch in line
git merge 6cca8d77c.pre-commit run --all-filesand commit the result.git merge -X ours <this PR's merge commit>. Where both sides reformatted the same lines, this keeps the branch's own formatted lines.pre-commit run --all-filesagain; it must come back clean.git diffagainst develop shows only the branch's real changes.Done this way, the branch's diff carries no formatting churn. PRs #625, #626 and #627 have already been brought in line this way.
Regression report
gal_resistive_pereads N/A on both refs by design: its perturbed-equilibrium stage waits on #635.Notes for reviewers
.git-blame-ignore-revsstays valid. If it's squashed,.git-blame-ignore-revsneeds a follow-up with the new hash.🤖 Generated with Claude Code
https://claude.ai/code/session_01VdRsGGg4YRG6E9fgLGbpdF