Skip to content

chore(typing): move mypy to strict and ban Any inside pgqueuer - #797

Merged
janbjorge merged 2 commits into
mainfrom
typing/09-strict-config
Sep 7, 2026
Merged

chore(typing): move mypy to strict and ban Any inside pgqueuer#797
janbjorge merged 2 commits into
mainfrom
typing/09-strict-config

Conversation

@janbjorge

Copy link
Copy Markdown
Owner

Part 9/9 of the strict-mypy series. Stacked on #796; merge in order, I rebase the rest after each merge.

Turn on strict = true, warn_unreachable and the bug-finding error
codes (truthy-bool, truthy-iterable, redundant-expr, unused-awaitable,
possibly-undefined, ignore-without-code). Inside pgqueuer/ an override
adds disallow_any_explicit and disallow_any_unimported; tests stay
strict but may use Any. The pydantic plugin runs with init_typed and
init_forbid_extra, so model constructors are checked like any other
signature; DBSettings needs populate_by_name for the plugin to type
its AliasChoices fields.

Tests that built models from bare literals now wrap them in the domain
NewTypes or go through model_validate(). AGENTS.md documents the new
rules and RELEASE.md lists every public signature that moved across
the typing series.

@janbjorge
janbjorge force-pushed the typing/09-strict-config branch 2 times, most recently from c3a8ed8 to dfb9978 Compare September 6, 2026 17:48
@janbjorge
janbjorge force-pushed the typing/09-strict-config branch 2 times, most recently from 5ecc326 to 906e174 Compare September 6, 2026 18:24
@janbjorge
janbjorge force-pushed the typing/09-strict-config branch from 906e174 to 245b87e Compare September 6, 2026 18:31
@janbjorge
janbjorge force-pushed the typing/09-strict-config branch from 245b87e to 2ed8e7d Compare September 6, 2026 18:33
@janbjorge
janbjorge force-pushed the typing/09-strict-config branch from 2ed8e7d to dae50bc Compare September 6, 2026 18:38
@janbjorge
janbjorge force-pushed the typing/09-strict-config branch from dae50bc to a7cbdda Compare September 6, 2026 18:41
@janbjorge
janbjorge force-pushed the typing/09-strict-config branch from a7cbdda to 40991a5 Compare September 6, 2026 18:43
Base automatically changed from typing/08-findings to main September 6, 2026 18:45
Turn on `strict = true`, `warn_unreachable` and the bug-finding error
codes (truthy-bool, truthy-iterable, redundant-expr, unused-awaitable,
possibly-undefined, ignore-without-code). Inside pgqueuer/ an override
adds `disallow_any_explicit` and `disallow_any_unimported`; tests stay
strict but may use Any. The pydantic plugin runs with `init_typed` and
`init_forbid_extra`, so model constructors are checked like any other
signature; DBSettings needs `populate_by_name` for the plugin to type
its AliasChoices fields.

Tests that built models from bare literals now wrap them in the domain
NewTypes or go through model_validate(). AGENTS.md documents the new
rules and RELEASE.md lists every public signature that moved across
the typing series.
@janbjorge
janbjorge force-pushed the typing/09-strict-config branch from 40991a5 to e1730a1 Compare September 6, 2026 18:45
@janbjorge
janbjorge merged commit 78d445f into main Sep 7, 2026
22 checks passed
@janbjorge
janbjorge deleted the typing/09-strict-config branch September 7, 2026 05:59
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