Skip to content

[pre-commit.ci] pre-commit autoupdate - #396

Closed
pre-commit-ci[bot] wants to merge 2 commits into
masterfrom
pre-commit-ci-update-config
Closed

pre-commit-ci[bot] wants to merge 2 commits into
masterfrom
pre-commit-ci-update-config

Conversation

@pre-commit-ci

@pre-commit-ci pre-commit-ci Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from ea22dd3 to 835c453 Compare May 11, 2026 16:36
@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.85%. Comparing base (bff75ed) to head (ded3b80).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #396   +/-   ##
=======================================
  Coverage   95.85%   95.85%           
=======================================
  Files          64       64           
  Lines        3619     3620    +1     
=======================================
+ Hits         3469     3470    +1     
  Misses        150      150           
Flag Coverage Δ
pytests 95.85% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 7437568 to f664556 Compare May 25, 2026 16:37
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 1f3102a to 86d3043 Compare June 8, 2026 16:38
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 767e5ea to ecfc0c2 Compare June 22, 2026 16:38
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from ecfc0c2 to e22370a Compare June 29, 2026 16:38
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 4531a30 to eea04a0 Compare July 20, 2026 16:38
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from eea04a0 to bc204cd Compare July 27, 2026 16:38
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from 75d1f79 to 359d93d Compare August 3, 2026 16:39
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from 10f9c14 to 49daf7c Compare August 10, 2026 16:40
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch 2 times, most recently from 8d1c569 to e7233d3 Compare August 24, 2026 16:41
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from 726d5fc to b89c2a9 Compare August 31, 2026 16:43
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.15.12 → v0.16.6](astral-sh/ruff-pre-commit@v0.15.12...v0.16.6)
- [github.com/pre-commit/mirrors-mypy: v1.20.2 → v2.3.1](pre-commit/mirrors-mypy@v1.20.2...v2.3.1)
@pre-commit-ci
pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from cc13b9c to 9f8da54 Compare September 7, 2026 16:42

Copy link
Copy Markdown
Member

Closing in favour of #424, a fresh pre-commit autoupdate on current master with the same hook bumps (ruff 0.16.6, mypy 2.3.1). The autofix here had inserted an unguarded from typing_extensions import Self into markdown_it/tree.py, which is not a runtime dependency and is why the 3.11–3.13 jobs failed; #424 guards it under TYPE_CHECKING and clears the remaining lint findings.


Generated by Claude Code

chrisjsewell added a commit that referenced this pull request Sep 9, 2026
## Summary

A fresh `pre-commit autoupdate` on current master, replacing #396 (the
bot's May branch), whose CI was red because the ruff autofix had
inserted an unguarded `from typing_extensions import Self` into
`markdown_it/tree.py` while `typing_extensions` is not a runtime
dependency.

| hook | before | after |
|---|---|---|
| `astral-sh/ruff-pre-commit` | v0.15.12 | v0.16.6 |
| `pre-commit/mirrors-mypy` | v1.20.2 | v2.3.1 |
| `pre-commit/pre-commit-hooks` | v6.0.0 | v6.0.0 (unchanged) |

Two commits: the hook bump plus the hooks' own auto-fixes, then the
manual fixes for what remained. The first commit alone is not
runtime-safe (see below), so squash-merge is the right choice here.

## What changed and why

**Runtime-safety fix.** ruff's PYI019 autofix rewrites the `self:
_NodeType` pattern in `SyntaxTreeNode` to `Self`, importing it from
`typing_extensions`. That import is now under `if TYPE_CHECKING:` (the
module already has `from __future__ import annotations`, and every use
of `Self` is annotation-only). Verified by importing `markdown_it.tree`
and calling `SyntaxTreeNode(...).pretty()` with `typing_extensions`
blocked via a meta-path finder. Nothing was added to `dependencies`.

**Manual lint fixes** (all from ruff 0.16's expanded default rule set,
none from rules this repo selects):
- `EXE001`: removed the vestigial shebang from
`markdown_it/cli/parse.py` (the CLI ships via the console script;
`python -m markdown_it.cli.parse` still works).
- `PIE810`: `k.startswith(("render", "_"))` in `renderer.py`.
- `PYI045`: `OptionsDict.__iter__` now declares `Iterator[str]` (it
always returned one), dropping a `type: ignore`.
- `PYI034`: `__new__` in a test helper annotated with `Self`.
- `RUF036`/`UP045`: `None | X` unions reordered to `X | None`.
Type-equivalent.
- mypy 2.3: one now-unused `type: ignore[import-untyped]` removed.

**Autofix changes worth knowing about** (all type-equivalent or
comment-only):
- `Token.attrSet(value: str | int | float)` now reads `str | float`
(PYI041). Under PEP 484's numeric tower `float` already accepts `int`,
so nothing changes for callers, but rendered signatures will look
narrower.
- Two `# noqa: E731` comments in `fence.py` removed by RUF100: ruff 0.16
no longer flags those lambdas, so the comments were dead, and the hook
auto-removes them if restored.
- ruff-format 0.16 now formats Python code inside Markdown fences, hence
the diffs in `README.md`, `AGENTS.md`, `CHANGELOG.md` and `docs/`. All
are formatting-only inside fenced examples (quotes, wrapping, `...`
stubs); no prose changed.

## For the maintainers to decide (not changed here)

With `pyproject.toml` untouched, ruff 0.16.6 enables **463** rules
versus **253** under 0.15.12: the defaults grew substantially (EXE, PIE,
PYI, UP007/UP045 and more are now on without being selected). It may be
worth pinning an explicit `select` so future ruff releases don't
silently change what's enforced.

## Verification

- `pre-commit run --all-files`: every hook passes under the new pins.
- 993 tests pass.
- `import markdown_it, markdown_it.tree, markdown_it.cli.parse` succeeds
with `typing_extensions` unavailable.

Supersedes #396.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant