Files
2026-10-24 01:50:24 +08:00

58 lines
2.4 KiB
INI

# mypy configuration for this repository.
#
# The repository is designed to check out and run its gates with only the standard library plus
# pytest (see pytest.ini and .github/workflows/ci.yml): frida, capstone, tiktoken and PyYAML are
# optional runtime dependencies that scripts import lazily or behind try/except, with documented
# fallbacks. Do not require them -- or their stubs -- to be installed for
# `mypy *.py skills/exe-reverse/scripts/*.py` to pass. When they *are* installed and typed
# (e.g. types-PyYAML), mypy still uses the real stubs; these overrides only apply where the module is
# missing or untyped.
#
# When installed, capstone ships no py.typed marker; frida and tiktoken are host-side extras.
# Everything else in the tree is analyzed normally, including every gate script -- which is the point:
# check_repo/check_refs/check_budget/check_routing/check_commands carry the behaviour of the whole
# repository, so they are worth type-checking rather than excluding.
#
# Enforced in CI: the `lint` job in .github/workflows/ci.yml runs mypy with exactly this
# configuration, on a bare interpreter (no frida/capstone/tiktoken/PyYAML installed), so the
# overrides below are exercised rather than skipped.
#
# Verified locally on 2026-10-16: `mypy` over the gate scripts and skills/exe-reverse/scripts
# reports no issues with the overrides in place, on an interpreter carrying only mypy, flake8,
# pytest and tiktoken.
#
# `python_version` is 3.10 and not lower: mypy refused to run at all under a 3.9 target on the
# version CI installs ("Python 3.9 is not supported (must be 3.10 or higher)"), which failed the
# lint job before a single file was checked. The floor here is therefore the floor mypy will
# check, and the shipped scripts keep their compatibility fallbacks -- `sys.stdlib_module_names`
# and `os.listdrives` are both probed rather than assumed -- so an older interpreter still runs
# them even though the type checker no longer targets one.
[mypy]
python_version = 3.10
warn_unused_ignores = False
[mypy-frida]
ignore_missing_imports = True
[mypy-frida.*]
ignore_missing_imports = True
[mypy-capstone]
ignore_missing_imports = True
[mypy-capstone.*]
ignore_missing_imports = True
[mypy-tiktoken]
ignore_missing_imports = True
[mypy-tiktoken.*]
ignore_missing_imports = True
[mypy-yaml]
ignore_missing_imports = True
[mypy-yaml.*]
ignore_missing_imports = True