refactor(template): five strict type checkers and bump style tooling - #26
Merged
Conversation
cliff.toml and .cliffignore configured git-cliff for a changelog that was never wired to any workflow, hook, or task. Changelog generation for generated projects is owned by release-please, and the template repo itself has no git-cliff invocation, so these files were dead config.
Align the template's tooling with the release-please pipeline and remove overlapping/conflicting tools that duplicated its or each other's work. Commitizen (ADR-004): scope to Conventional Commit authoring/linting only. release-please owns version bumping, git tagging, and CHANGELOG.md, so drop the [tool.commitizen] bump/tag/changelog keys (they competed over the same tags and changelog file) and the commented-out bump-my-version dep. Lint orchestration (ADR-003): make the uv-backed tox `style` env the single canonical lint/type-check runner; default include_pants and include_trunk to off (opt-in) so a default project's full suite lives in one place with one set of versions. Remove redundant/conflicting tools: black and isort (ruff owns format + import sorting), codespell (typos), and legacy markdownlint (markdownlint-cli2). Pre-commit: make hooks always-on and remove the include_precommit toggle. Standardize the runner on prek across the dependency group, the tox `pre-commit` env, and the CI `hooks` job (previously split between pre-commit and prek, which left the CI job calling an uninstalled binary). Sync docs (README, CLAUDE.md, AGENTS.md) and add ADR-003 and ADR-004.
Replace pyright with strict basedpyright and invoke all installed type checkers (mypy x2, basedpyright, ty, pyrefly, zuban). Wiring in the former dead-weight tools surfaced two latent bugs, both fixed: a [tool.pyright] venvPath misconfiguration and a BINDINGS type-invariance error in tui/app.py. Generated code is fixed to satisfy basedpyright's full strict ruleset (typing_extensions for @OverRide, ClassVar/@Final annotations, _ = discards, single-string literals) rather than relaxing it; the one unavoidable library-boundary Any (MCP tool args) carries an explicit # pyright: ignore. Bump all style-group tools to latest (mypy 2.1.0, basedpyright 1.39.8, ty 0.0.53, pyrefly 1.1.1, zuban 0.9.0, ruff 0.15.19, vulture 2.16, typos 1.47.2, actionlint-py 1.7.12.24, slotscheck 0.20.0, editorconfig-checker 3.6.1, validate-pyproject 0.25) and align the pre-commit and trunk version pins. zuban 0.9 fixed an earlier misc miscategorization, restoring mypy strictness in mcp/app.py; basedpyright 1.39 flagged a set_event_loop_policy deprecation, so the worker is modernized to uvloop.run(). Remove bandit (pre-commit hook, trunk entry, commented dep) and the commented pyupgrade-directories dep; ruff's S and UP rules cover both under select=ALL. Verified: tox -e style and tox -e pre-commit pass on default and litestar+mcp+worker renders. See ADR-005.
Contributor
There was a problem hiding this comment.
Sorry @hasansezertasan, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 973e613da7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…, render ruff-clean
Migrate generated projects from a pre-commit `.pre-commit-config.yaml` to a
native `prek.toml`, drop the `include_commitizen` toggle, fix the c-extensions
style suite, and clean up rendered-output whitespace across all components.
- prek: replace `.pre-commit-config.yaml.jinja` with `prek.toml.jinja` (builtin
repo for simple hooks; upstream repo kept for check-yaml --unsafe /
debug-statements / check-ast). Drop the pre-commit.ci `ci:` block and the
sync-with-uv hook; Renovate now bumps hook revs via a customManagers regex
(its built-in pre-commit manager only reads .pre-commit-config.yaml). Rename
the `pre-commit` dep group / tox env / mise task to `prek`; bump prek to 0.4.3.
- commitizen: always included (the toggle already defaulted true and its hooks
were unconditional, so the gate only added inconsistency). Remove the
copier.yml variable and the conditionals around the dep and `[tool.commitizen]`.
- c-extensions style: ignore preview RUF067 on the package __init__ and gate
basedpyright reportMissingModuleSource / reportImplicitStringConcatenation when
C extensions are enabled (the .pyi stub has no in-tree source; ruff's formatter
keeps the warning string implicitly concatenated).
- whitespace: fix 16 template files so rendered output is ruff-clean without
relying on fix=true / mutating `ruff format` (Jinja `{%- -%}` strip markers,
magic-comma collapses, isort, pytest->TYPE_CHECKING). Make profile.py
executable (EXE001) and tidy its file-level noqa.
- docs: update README, CLAUDE.md, AGENTS.md, ADR-003/004 to match.
…lways-on, slim CHANGELOG to release-please stub Drop five copier toggles to shrink the matrix and remove vestigial tooling. - Remove Pants and Trunk entirely: delete pants.toml.jinja and the .trunk/ directory (trunk.yaml + hadolint/markdownlint configs); the tox `style` env is now the sole lint/build orchestrator a generated project ships. - Make Codecov always-on: rename to .codecov.yml.jinja and run the CI coverage upload unconditionally (needs CODECOV_TOKEN). - Make mise always-on: rename to mise.toml.jinja; unconditional devcontainer mise feature and VS Code mise extension. - Make the changelog always-on: this resolves a latent inconsistency, since release-please (changelog-path: CHANGELOG.md) generated the file regardless of the old "link to Releases" mode. - Slim CHANGELOG.md to a minimal release-please-owned stub: the Keep-a-Changelog skeleton (Unreleased section + changelog-start/end markers) was a git-cliff-era leftover that conflicts with release-please's default emoji-section format. - Remove the include_pants/include_trunk/include_codecov/include_changelog/ include_mise variables from copier.yml and .example-input.yml; drop include_codecov=true from the meta-CI render matrix. - Docs: update README, CLAUDE.md, AGENTS.md; add a dated supersession note to ADR-003 (pants/trunk removed, not merely opt-in) and clean stale include_changelog references in ADR-002/004.
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.
Summary
Hardens the generated project's type-checking and refreshes the lint toolchain.
pyrightand invokes strictbasedpyright(its superset) alongsidemypy(×2 versions),ty,pyrefly, andzuban— the two previously-installed-but-never-run tools now pull their weight.[tool.pyright]venvPathmisconfiguration (.venv/.venv), and aBINDINGStype-invariance error intui/app.py.@overrideviatyping_extensions,ClassVar/@finalannotations,_ =discards, single-string literals. The one unavoidable library-boundaryAny(MCP tool args) carries an explicit# pyright: ignore.miscmiscategorization (restored mypy strictness inmcp/app.py), and basedpyright 1.39 flagged aset_event_loop_policydeprecation (worker modernized touvloop.run()).pyupgrade-directories— ruff'sS/UPrules cover both underselect=ALL.pyrighthook is replaced by a localbasedpyrighthook.Decision recorded in ADR-005.
Test plan
tox -e style→ green on a default render and a litestar + MCP + worker render (all five checkers + ruff/vulture/slotscheck/taplo/validate-pyproject/typos/actionlint).tox -e pre-commit→ green; all bumped hooks and the local basedpyright hook resolve and install.