From 9a5ddb171a499ebfcc4a51a7a31db7ba30028087 Mon Sep 17 00:00:00 2001 From: nstarman Date: Tue, 15 Sep 2026 11:17:41 -0400 Subject: [PATCH 1/7] fix(ci): skip no-commit-to-branch in the full-suite CI run no-commit-to-branch was blocking every push to main: CI checks out a real local branch literally named `main` for push events, so the hook always fired. It's a client-side guard for a human running `git commit`/`git push` locally (or via installed git hooks) -- not something a full "run every hook" CI invocation should re-evaluate after the fact. Skips it there via SKIP=no-commit-to-branch; the hook itself is untouched and still fully active locally. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/ci.yml | 6 ++++++ noxfile.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09dfa08..93cc462 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,12 @@ jobs: - uses: j178/prek-action@v3.0.0 with: extra-args: --all-files + env: + # no-commit-to-branch always fails here: CI checks out the real + # `main` branch on every push, which is exactly what the hook + # exists to block for a human running `git commit`/`git push` + # locally. + SKIP: no-commit-to-branch checks: name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} diff --git a/noxfile.py b/noxfile.py index aed41d2..d1e2d23 100644 --- a/noxfile.py +++ b/noxfile.py @@ -17,12 +17,16 @@ def lint(session: nox.Session) -> None: """Run the linter.""" session.install("prek") + # no-commit-to-branch always fails here: CI checks out the real + # `main` branch on every push, which is exactly what the hook exists to + # block for a human running `git commit`/`git push` locally. session.run( "prek", "run", "--all-files", "--show-diff-on-failure", *session.posargs, + env={"SKIP": "no-commit-to-branch"}, ) From 1c7320d3acfbd628da4ca2f286b7ac94b89a915f Mon Sep 17 00:00:00 2001 From: nstarman Date: Tue, 15 Sep 2026 11:40:17 -0400 Subject: [PATCH 2/7] fix(ci): don't clobber an existing SKIP when skipping no-commit-to-branch Appends no-commit-to-branch to any SKIP a developer already has set (e.g. via their shell) rather than overwriting it wholesale, matching the same fix applied in response to Copilot review feedback on GalacticDynamics/coordinax#885. Co-Authored-By: Claude Sonnet 5 --- noxfile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index d1e2d23..20d6bec 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,6 +1,7 @@ """Nox configuration.""" import argparse +import os import shutil from pathlib import Path @@ -19,14 +20,16 @@ def lint(session: nox.Session) -> None: session.install("prek") # no-commit-to-branch always fails here: CI checks out the real # `main` branch on every push, which is exactly what the hook exists to - # block for a human running `git commit`/`git push` locally. + # block for a human running `git commit`/`git push` locally. Add it to + # any SKIP a caller already set, rather than clobbering it. + skip = ",".join(filter(None, [os.environ.get("SKIP"), "no-commit-to-branch"])) session.run( "prek", "run", "--all-files", "--show-diff-on-failure", *session.posargs, - env={"SKIP": "no-commit-to-branch"}, + env={"SKIP": skip}, ) From 46e7a5a548018871e0fbc2e95e332e4e3ba3e7c4 Mon Sep 17 00:00:00 2001 From: nstarman Date: Tue, 15 Sep 2026 12:29:52 -0400 Subject: [PATCH 3/7] docs(nox): clarify the no-commit-to-branch skip isn't CI-specific Addresses Copilot review feedback on GalacticDynamics/galax#847: the comment said "CI checks out the real main branch," but the skip applies unconditionally, including local `nox -s lint` runs -- which is correct (a CI-only skip would leave the same false failure for any local dev running the full suite while on `main`). Fixes the wording to match the actual, intended behavior instead of narrowing it. Co-Authored-By: Claude Sonnet 5 --- noxfile.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index 20d6bec..5712afd 100644 --- a/noxfile.py +++ b/noxfile.py @@ -18,10 +18,12 @@ def lint(session: nox.Session) -> None: """Run the linter.""" session.install("prek") - # no-commit-to-branch always fails here: CI checks out the real - # `main` branch on every push, which is exactly what the hook exists to - # block for a human running `git commit`/`git push` locally. Add it to - # any SKIP a caller already set, rather than clobbering it. + # no-commit-to-branch guards a human's local `git commit`/`git push`, + # not a manual "run every hook over all files" invocation like this + # one -- which CI also runs on every push to `main`, where it would + # otherwise always fail. Skipped here (locally or in CI); the + # installed git hook still catches the real case. Add it to any SKIP + # a caller already set, rather than clobbering it. skip = ",".join(filter(None, [os.environ.get("SKIP"), "no-commit-to-branch"])) session.run( "prek", From b74ff19529d52412403d20200fdc8e38bcb2fe69 Mon Sep 17 00:00:00 2001 From: nstarman Date: Tue, 15 Sep 2026 12:41:44 -0400 Subject: [PATCH 4/7] docs(nox): fix now-inaccurate git-push mention in the SKIP comment Addresses Copilot review feedback on GalacticDynamics/galax#847: this comment still said no-commit-to-branch guards `git push`, but the earlier stages: [pre-commit] fix means it no longer runs on push at all. Clarifies that explicitly instead of leaving stale wording. Co-Authored-By: Claude Sonnet 5 --- noxfile.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/noxfile.py b/noxfile.py index 5712afd..e348ac3 100644 --- a/noxfile.py +++ b/noxfile.py @@ -18,12 +18,13 @@ def lint(session: nox.Session) -> None: """Run the linter.""" session.install("prek") - # no-commit-to-branch guards a human's local `git commit`/`git push`, - # not a manual "run every hook over all files" invocation like this - # one -- which CI also runs on every push to `main`, where it would - # otherwise always fail. Skipped here (locally or in CI); the - # installed git hook still catches the real case. Add it to any SKIP - # a caller already set, rather than clobbering it. + # no-commit-to-branch guards a human's local `git commit` (it's + # scoped to stages: [pre-commit] in .pre-commit-config.yaml, so it + # never runs on push) -- not a manual "run every hook over all files" + # invocation like this one, which CI also runs on every push to + # `main`, where it would otherwise always fail. Skipped here (locally + # or in CI); the installed git hook still catches the real case. Add + # it to any SKIP a caller already set, rather than clobbering it. skip = ",".join(filter(None, [os.environ.get("SKIP"), "no-commit-to-branch"])) session.run( "prek", From 1cdd4c4e14237ad90475657c1425c9fccb92b71d Mon Sep 17 00:00:00 2001 From: nstarman Date: Tue, 15 Sep 2026 12:43:21 -0400 Subject: [PATCH 5/7] docs(ci): fix now-inaccurate git-push mention in the SKIP comment Addresses Copilot review feedback on GalacticDynamics/galax#847: this comment still said no-commit-to-branch guards `git push`, but the earlier stages: [pre-commit] fix means it no longer runs on push at all. Clarifies that explicitly instead of leaving stale wording. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93cc462..baea7fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,9 +30,9 @@ jobs: extra-args: --all-files env: # no-commit-to-branch always fails here: CI checks out the real - # `main` branch on every push, which is exactly what the hook - # exists to block for a human running `git commit`/`git push` - # locally. + # `main` branch on every push, which is exactly what this hook + # exists to block for a human running `git commit` locally (it's + # scoped to stages: [pre-commit], so it never fires on push). SKIP: no-commit-to-branch checks: From 9e0a7c2d1ded93e6efcdae9b8dfe03e7885dc660 Mon Sep 17 00:00:00 2001 From: nstarman Date: Tue, 15 Sep 2026 12:55:51 -0400 Subject: [PATCH 6/7] docs: disambiguate "never fires on push" from the workflow's own push trigger Addresses Copilot review feedback on GalacticDynamics/galax#847: "it never fires on push" reads as a claim about this workflow's own `on: push:` trigger (which is false -- that's why the SKIP exists at all), when it actually means the git pre-push hook stage. Spells that out explicitly. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/ci.yml | 6 ++++-- noxfile.py | 11 ++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index baea7fa..919cd96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,8 +31,10 @@ jobs: env: # no-commit-to-branch always fails here: CI checks out the real # `main` branch on every push, which is exactly what this hook - # exists to block for a human running `git commit` locally (it's - # scoped to stages: [pre-commit], so it never fires on push). + # exists to block for a human running `git commit` locally. It's + # scoped to stages: [pre-commit] in .pre-commit-config.yaml, so + # it never fires as a pre-push git hook -- unrelated to this + # workflow's own push trigger above. SKIP: no-commit-to-branch checks: diff --git a/noxfile.py b/noxfile.py index e348ac3..c18c132 100644 --- a/noxfile.py +++ b/noxfile.py @@ -20,11 +20,12 @@ def lint(session: nox.Session) -> None: session.install("prek") # no-commit-to-branch guards a human's local `git commit` (it's # scoped to stages: [pre-commit] in .pre-commit-config.yaml, so it - # never runs on push) -- not a manual "run every hook over all files" - # invocation like this one, which CI also runs on every push to - # `main`, where it would otherwise always fail. Skipped here (locally - # or in CI); the installed git hook still catches the real case. Add - # it to any SKIP a caller already set, rather than clobbering it. + # never fires as a pre-push git hook) -- not a manual "run every + # hook over all files" invocation like this one, which CI also runs + # on every push to `main`, where it would otherwise always fail. + # Skipped here (locally or in CI); the installed git hook still + # catches the real case. Add it to any SKIP a caller already set, + # rather than clobbering it. skip = ",".join(filter(None, [os.environ.get("SKIP"), "no-commit-to-branch"])) session.run( "prek", From eed52ec30393024066a6065d5fd5a944424dd346 Mon Sep 17 00:00:00 2001 From: nstarman Date: Tue, 15 Sep 2026 13:53:21 -0400 Subject: [PATCH 7/7] docs: trim verbose inline comments down to the load-bearing WHY The archaeology (why pre-commit's nodeenv/pyyaml floors mattered, why --skip clobbers, the full CI-checkout explanation) belongs in commit history, not permanently inline. Keeps just enough to orient a future reader without re-litigating the whole investigation. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/ci.yml | 7 +------ noxfile.py | 10 ++-------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 919cd96..83e13f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,12 +29,7 @@ jobs: with: extra-args: --all-files env: - # no-commit-to-branch always fails here: CI checks out the real - # `main` branch on every push, which is exactly what this hook - # exists to block for a human running `git commit` locally. It's - # scoped to stages: [pre-commit] in .pre-commit-config.yaml, so - # it never fires as a pre-push git hook -- unrelated to this - # workflow's own push trigger above. + # Not a real commit -- no-commit-to-branch would always fail here. SKIP: no-commit-to-branch checks: diff --git a/noxfile.py b/noxfile.py index c18c132..328eca2 100644 --- a/noxfile.py +++ b/noxfile.py @@ -18,14 +18,8 @@ def lint(session: nox.Session) -> None: """Run the linter.""" session.install("prek") - # no-commit-to-branch guards a human's local `git commit` (it's - # scoped to stages: [pre-commit] in .pre-commit-config.yaml, so it - # never fires as a pre-push git hook) -- not a manual "run every - # hook over all files" invocation like this one, which CI also runs - # on every push to `main`, where it would otherwise always fail. - # Skipped here (locally or in CI); the installed git hook still - # catches the real case. Add it to any SKIP a caller already set, - # rather than clobbering it. + # Not a real commit -- no-commit-to-branch would always fail here. + # Merge into any SKIP already set, rather than clobber it. skip = ",".join(filter(None, [os.environ.get("SKIP"), "no-commit-to-branch"])) session.run( "prek",