Added the menu category delete route. Fix: Show blank vouchers in tables Fix: In rare cases, the old settements can stick around. fixed it.
1.8 KiB
1.8 KiB
name, description
| name | description |
|---|---|
| strict-mypy | Enforces strict MyPy type checking conventions matching the project's pyproject.toml configuration. Use whenever writing or modifying Python code. |
Strict MyPy Typing Standards
This project uses a highly strict MyPy configuration (strict = true). When writing or refactoring Python code, you MUST adhere to the following rules to ensure the code passes type checking:
1. Absolute Signature Completeness
- EVERY function and method must have fully typed arguments and a return type (
disallow_untyped_defs,disallow_incomplete_defs). - ALWAYS specify
-> Nonefor functions and methods that do not return a value. - NEVER leave type hints partially defined (e.g., typing only some arguments).
- Decorators must be completely type-hinted using
typing.Callableortyping.ParamSpec(disallow_untyped_decorators).
2. No Implicit Optionals
arg: str = Noneis strictly forbidden.- You MUST explicitly union with None:
arg: str | None = None(no_implicit_optional).
3. Strict Generics
- NEVER use bare collections as types.
- ALWAYS specify the inner types: use
list[str],dict[str, int], ortuple[int, ...]instead of barelist,dict, ortuple(disallow_any_generics).
4. Restrictions on Any and Subclassing
- Do not subclass from untyped external libraries or
Any(disallow_subclassing_any). - Avoid using external types that have no stubs and resolve to
Any(disallow_any_unimported). - Refrain from returning
Anyto avoid contaminating the type inference of calling functions (warn_return_any).
5. Pydantic Strictness
pydantic.mypyis active with strict initialization.- When instantiating Pydantic models, ensure you are passing exactly the expected typed arguments, as extra or untyped arguments will fail type checks (
init_typed = true,init_forbid_extra = true).