Switch to post-merge air formatting on main - #135
Merged
Conversation
Replace the pre-merge format-suggest check with a format-main workflow that runs air format . on push to main and commits any changes back. Contributors no longer need a green formatting gate, but are still expected to run air format . locally (see CLAUDE.md) so the diff under review is the diff that lands and main stays free of formatting-only commits. - Remove .github/workflows/format-suggest.yaml. - Add .github/workflows/format-main.yaml (push: main, commit back). It checks out with FORMAT_BOT_TOKEN, a fine-grained PAT with Contents read and write owned by a repository admin, because the default GITHUB_TOKEN is not on the bypass list of the "Not push in main" ruleset and so cannot push. The job fails early, with an explanatory message, when that secret is unset. - Update CLAUDE.md and .github/CONTRIBUTING.md: five CI checks rather than six, and formatting documented as a local requirement with no pre-merge gate. Implements the post-merge-only option from #134. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
eduaguilera
force-pushed
the
chore/postmerge-air-format
branch
from
August 13, 2026 09:21
215083a to
64f900a
Compare
Whitespace-only noise (comma spacing and indentation) in R/validation_helpers.R, so the first push to main after this merges gives format-main something to fix. Verified locally: air 0.9.0 restores the file byte-for-byte, and lintr reports no lints, because the deviations are confined to the four linters disabled in .lintr precisely because air owns them. The format-main commit on main should therefore revert exactly this hunk and nothing else. The pre-merge format-suggest run on this PR fails by design: it comes from the base branch, and deleting it is the point of this PR. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment on lines
+11
to
+12
| .conservation_rel_error <- function(gridded,reference) { | ||
| dplyr::case_when( |
Contributor
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
Suggested change
| .conservation_rel_error <- function(gridded,reference) { | |
| dplyr::case_when( | |
| .conservation_rel_error <- function(gridded, reference) { | |
| dplyr::case_when( |
Comment on lines
+14
to
+15
| gridded > 0 ~ Inf, | ||
| .default = 0 |
Contributor
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
Suggested change
| gridded > 0 ~ Inf, | |
| .default = 0 | |
| gridded > 0 ~ Inf, | |
| .default = 0 |
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.
Implements the post-merge-only option from #134. Rebased onto current
main(the branch predated ~630 merges) and wired to a token that can actually push.
What changes
format-suggestworkflow.format-main— on push tomain, install air, runair format .,and commit any changes back via
git-auto-commit-action.CLAUDE.md,.github/CONTRIBUTING.md): five CI checks rather thansix, and formatting documented as a local requirement with no pre-merge gate —
run
air format .yourself so the diff under review is the diff that landsand
maindoes not accumulate formatting-only commits..github/copilot-instructions.md; that filehas since been deleted from
main, so the hunk is dropped.Repo setting required before this works
mainis protected by the "Not push in main" ruleset (pull_requestrule,1 approval). Its bypass list does not include
github-actions, so the defaultGITHUB_TOKENcannot push. The job therefore checks out withsecrets.FORMAT_BOT_TOKEN.That secret is a fine-grained PAT owned by a repository admin — repository
eduaguilera/whep, permission Contents: Read and write — and it is alreadyconfigured. Repository admins bypass the ruleset, so the ruleset itself needs no
change. The first job step fails with an explicit message when the secret is
missing, instead of dying on an opaque 403 at push time.
The commit carries
[skip ci]so a formatting-only change does not re-run thefive-platform check suite. Unlike a
GITHUB_TOKENcommit, a PAT-authored onewould trigger downstream workflows — drop
[skip ci]if that is ever wanted.Smoke test built into this PR
The second commit adds whitespace-only noise to
R/validation_helpers.R, sothe first push to
maingivesformat-mainsomething to fix. Verifiedlocally: air 0.9.0 restores the file byte-for-byte, and lintr reports no lints,
because the deviations are confined to the four linters
.lintrdisablesprecisely because air owns them. The auto-format commit on
mainshouldtherefore revert exactly that hunk and nothing else.
Note:
format-suggestfails on this PR by design. It is apull_request_targetworkflow, so GitHub runs the copy from the base branch — it sees the deliberate
mis-format and objects. Deleting it is the point of this PR.
🤖 Generated with Claude Code