Skip to content

chore: update pre-commit hooks - #321

Merged
bjlittle merged 1 commit into
mainfrom
pre-commit-ci-update-config
Sep 14, 2026
Merged

bjlittle merged 1 commit into
mainfrom
pre-commit-ci-update-config

Conversation

@pre-commit-ci

@pre-commit-ci pre-commit-ci Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@pre-commit-ci
pre-commit-ci Bot requested a review from bjlittle as a code owner September 14, 2026 17:23
@pre-commit-ci
pre-commit-ci Bot deployed to development September 14, 2026 17:24 Active
@github-actions github-actions Bot added the skip-changelog Exempt from the changelog fragment gate label Sep 14, 2026
@read-the-docs-community

read-the-docs-community Bot commented Sep 14, 2026

Copy link
Copy Markdown

bjlittle added a commit that referenced this pull request Sep 14, 2026
The fragment was written as `321.feature.rst` because that was the
next free number when the task that wrote it was dispatched. While the
work ran, `pre-commit-ci[bot]` opened #321, so this pull request is
#322 and the fragment named a number belonging to someone else.

`ci-changelog` asks every pull request for a fragment named after its
own number, so this would have failed the gate rather than slipped
through -- but it would have failed after review rather than before,
which is the wrong moment to learn it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h
bjlittle added a commit that referenced this pull request Sep 14, 2026
* Give each release a changelog title and an anchor

The towncrier template emitted no version headings: one release hid
the defect, and from the second the assembled CHANGELOG.rst was an
undivided run of entries with no anchor for a per-release whatsnew
page to link (whatsnew spec §3.3).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Point the plan's copyright constraint at the file that holds it

`notice-rgx` is in `pyproject.toml` under
`[tool.ruff.lint.flake8-copyright]`, not `.pre-commit-config.yaml`.
Task 1's implementer caught it; verified by grep, which matches
pyproject.toml alone.

The plan is not frozen yet -- docs spec §3.4 freezes a plan when its
implementation pull request merges, and that is this branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Define the version and build-date substitutions

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Gate the substitutions' built value, not conf.py's text

Review found _defined_substitutions() regex-scanned conf.py's source
text, a proxy that would pass on a substitution merely mentioned in a
comment and fail on a correctly-built rst_epilog written a different
way. Execute conf.py via tests/by_path.load_path and read the actual
rst_epilog attribute instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Give the changelog a preamble and an anchor for its newest release

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Add the what's new section

Creates docs/src/reference/whatsnew/ with the section index, the
`latest.rst` page being accumulated toward, and the seed template
copied into place at release time. Registers the section in the
reference toctree ahead of the changelog, and exempts the section
index from the reading-time banner since the included `latest.rst`
already carries one.

Also fixes a bug in the section index's `_pages()` test helper: it
globbed every `*.rst` in the directory, including `index.rst` itself,
so `test_the_toctree_lists_every_page_in_the_section` compared the
toctree against a set that could never match it (the index does not,
and should not, list itself). Excludes the index by name, matching
how a quadrant landing page's own table never names itself
(narrative spec §3.9, whatsnew spec §4).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Gate the two release-time whatsnew mistakes

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Report every offending page/substitution pair, not just the last

test_no_frozen_page_carries_the_substitutions keyed its offenders dict on
the page name while iterating both substitutions, so a page carrying both
reported only the last match. Key on the (page, substitution) pair instead.

Also bring _frozen() in line with its docstring: it excluded latest.rst by
name but still swept in the section index, which _pages() already excludes
by stem for the same reason.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Carry the what's new steps in the release sequence

Insert the freeze-the-what's-new-page step after getting on the release
branch, and the reseed-on-main step after the merge-back, renumbering The
Sequence from 1..13 and updating every step cross-reference on the page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Add the changelog fragment

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Fix the whatsnew placeholder gate, and tidy its fixtures

The placeholder gate asserted against latest.rst, keyed on the installed
version reaching the first release. Two failures followed: whatsnew spec
§3.5 step 3 reseeds latest.rst from the template -- placeholder and all --
after every release, so the gate read a freshly reseeded file as a defect
for the whole of the next cycle; and it read latest.rst unconditionally, so
it raised FileNotFoundError through the frozen window between a release's
tag and its merge-back, where the file does not exist at all.

The rule belongs to the frozen page, not latest.rst: a frozen page carrying
TBD is always wrong, needs no release signal, and fires on the release pull
request rather than at the tag. Rewritten over _frozen(), the same corpus
test_no_frozen_page_carries_the_substitutions already reads, reporting every
offending page. FIRST_RELEASE, the pytest.skip, and the now-unused pytest/
Version/tephpy imports are removed.

While in the file: _toctree_entries() was a fourth-hand copy of
test_docs_landing_pages.toctree_entries(), unbounded past the toctree's end
-- replaced with the shared, unit-tested helper. _rendered()'s docstring
claimed a context fidelity to towncrier it did not have (versiondata as a
SimpleNamespace rather than towncrier's dict, and the wrong underlines) --
made faithful rather than just honest about the gap, since both were
possible. _defined_substitutions()'s docstring now names the side effects of
executing conf.py: the plot-scratch directory, the sys.path entry, and the
sys.modules registration.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Correct the whatsnew spec's placeholder gate, and a stale step number

§4's third gate stated the rule about latest.rst and contradicted §3.5 step
3 three paragraphs above it, which reseeds latest.rst from the template --
placeholder and all -- after every release. The gate as written was modelled
on start spec §3.7's pre-release note, but that note makes one transition
and stays retired, while this state is cyclic. Rewritten to state the rule
about the frozen page instead, matching the test fix on this branch.

§6 also cited developer/release.rst step 11 for where announcing is left to
a person; renumbering moved it to step 13.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Mention what's new in the reference quadrant's opening prose

The quadrant's introduction enumerated its pages but never named the new
What's New section -- only the toctree gained the entry. whatsnew spec §3.1
places it before changelog because the highlights are what a reader meets
first; the prose now routes them past it in the same order.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Link the changelog fragment to the section, not its design spec

The fragment linked whatsnew-spec-1, so a reader of the published changelog
who clicked "What's New" landed on a developer design specification instead
of the section itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Warn that step 2 leaves the changelog anchor undefined until step 3

Step 2 has the maintainer repoint the what's new page's changelog link at
changelog-vX.Y.Z, but step 3 is what assembles the file that defines that
anchor. A pixi run docs between the two steps hit an undefined label with
nothing telling the reader it was expected rather than a mistake.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

* Correct three prose defects in the what's new docs

- docs-style.rst's reading-time exemption list described the whatsnew
  index as directive-generated; it is an include of an already-bannered
  page, not a directive body.
- The whatsnew design spec understated the superseded placeholder gate:
  it did not read nothing through the frozen window, it read latest.rst
  unconditionally and raised FileNotFoundError there.
- The spec's §3.5 step 1 repoint now notes why the undefined
  changelog-vX.Y.Z label between steps 1 and 3 is acceptable: the
  release pull request's head carries both edits.

* Name the fragment for the pull request it belongs to

The fragment was written as `321.feature.rst` because that was the
next free number when the task that wrote it was dispatched. While the
work ran, `pre-commit-ci[bot]` opened #321, so this pull request is
#322 and the fragment named a number belonging to someone else.

`ci-changelog` asks every pull request for a fragment named after its
own number, so this would have failed the gate rather than slipped
through -- but it would have failed after review rather than before,
which is the wrong moment to learn it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDtaSBAWHdYhYfyyWCcC5h

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.16.6 → v0.16.7](astral-sh/ruff-pre-commit@v0.16.6...v0.16.7)
- [github.com/zizmorcore/zizmor-pre-commit: v1.30.0 → v1.30.1](zizmorcore/zizmor-pre-commit@v1.30.0...v1.30.1)
@bjlittle
bjlittle force-pushed the pre-commit-ci-update-config branch from 52f0da7 to 58af000 Compare September 14, 2026 20:48
@bjlittle
bjlittle enabled auto-merge (squash) September 14, 2026 20:51
@bjlittle
bjlittle merged commit 9c694b5 into main Sep 14, 2026
14 checks passed
@bjlittle
bjlittle deleted the pre-commit-ci-update-config branch September 14, 2026 20:51
@bjlittle
bjlittle deployed to development September 14, 2026 20:51 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
development 58af000e Deployed Sep 14, 2026 by bjlittle via welcome #94
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Exempt from the changelog fragment gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant