Add warn_unreachable = true to the mypy configuration. This detects
statements that mypy proves are unreachable, such as code after
an unconditional return or assertions that can never be true.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
Add the exhaustive-match error code to the mypy configuration. This
requires all match statements to be exhaustive, handling all possible
values of the matched expression.
The fix is to add 'case _: pass' to each match statement that is
intended to be non-exhaustive, making the non-exhaustiveness explicit.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
Add the truthy-iterable error code to the mypy configuration. This
detects Iterable parameters that are used in boolean contexts (if not
names, etc.) since Iterable values are always truthy.
The fix is to change Iterable[str] parameters to Collection[str] when
they are tested for emptiness, since Collection guarantees __len__.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
Add warn_unused_ignores = true to the mypy configuration. This warns
when a '# type: ignore' comment has no associated error code,
ensuring all type ignores are explicit about which error they suppress.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
Add disallow_any_generics = true to the mypy configuration. This
requires all generic types (dict, list, Iterable, Types, etc.) to
have explicit type arguments instead of using bare generic aliases.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
Add warn_redundant_casts = true to the mypy configuration template.
This rule detects casts that mypy proves unnecessary, helping to
clean up redundant type casts that clutter the codebase.
This is one of the boolean-flag rules being gradually adopted from
the stricter mypy profile in /tmp/pyproject.toml. It produces just
1 error during initial rollout.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
Add the truthy-bool error code to the mypy configuration. This
detects conditions and expressions that are always truthy because
the type has no __bool__ or __len__ method.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
Add the possibly-undefined error code to the mypy configuration.
This detects variables that may not be defined on all execution
paths, catching a class of NameError bugs at type-check time.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
Add the ignore-without-code error code to the mypy configuration.
This requires all # type: ignore comments to include a specific error
code, improving the precision and maintainability of type ignore
annotations.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
Add mypy's explicit-override error code and pyrightconfig's
reportImplicitOverride "error" directive. This requires all methods
that override base class methods to be decorated with @override from
typing. The change complements the previous commit, which added
exactly that decorator to all relevant methods.
Signed-off-by: Jan Lindemann <jan@janware.com>
conf/templates is not installed to /etc/opt/jw-pkg/templates. Fix
that so that other packages including py-topdir.mk can use the
templates.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add a [tool.mypy] section to pyproject.toml with a {mypypath}
template variable. The already existing template generation mechanism
in py-topdir.mk should fill that in with a path pointing to all
Python modules managed by jw-pkg:
[tool.mypy]
{mypypath}
Signed-off-by: Jan Lindemann <jan@janware.com>
pyproject.toml is currently copied unchanged from conf/topdir to the
toplevel directory. Set up machinery in py-topdir.mk to render it
from a template in conf/templates instead, replacing {mypypath} in
the process.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add $(TOPDIR)/conf/templates as a location for templates, i.e. input
files to the CmdCreateFile template rendering command.
Signed-off-by: Jan Lindemann <jan@janware.com>