SKY-R101 · Quality, structure and performance
Python type-check policy
A type checker (mypy or pyright) reads type annotations and catches calls with the wrong kind of value before the code runs. SKY-R101 reports a repository that contains Python code but has no mypy or pyright configuration.
- Languages
- Python
- Quality gate
- counted toward the gate limits (full and diff scans). Advice that is measured on every
--qualityscan but not listed by default. It is listed, and counted towardmax_quality, with--all-adviceor when the rule is named in[tool.skylos.gate] rules. A diff scan checks it only when the change touches a policy file such aspyproject.toml. - Finding type
- advice
Why it matters
Without a configured checker, annotations are only comments: nothing stops a change that passes a string where a number is expected, and each developer runs a different check, or none, before pushing.
What Skylos flags
[project]name = "shop"version = "1.0.0" [tool.ruff]line-length = 88"""Price helpers.""" def total(prices: list[float]) -> float: return sum(prices)What Skylos leaves alone
{ "include": ["app"], "typeCheckingMode": "strict"}Why Skylos leaves it alone
The type checker is configured in pyrightconfig.json instead of pyproject.toml. Skylos looks in every usual place, so the project has a type-check policy.
How Skylos decides
- Runs with
--quality, once per scanned project. A diff scan runs it only when a policy file (such aspyproject.toml,setup.cfg,mypy.iniorpyrightconfig.json) is among the changed files. - Checks that the project has at least one
.py,.pyior.pywfile, leaving out excluded folders and virtual environments. - Looks for a type-checker policy at the project root:
[tool.mypy]or[tool.pyright]inpyproject.toml, amypy.inifile, a[mypy]section in.mypy.iniorsetup.cfg, or apyrightconfig.jsonfile. - When none exists, reports MEDIUM on line 1 of
pyproject.toml, or on the project folder when there is nopyproject.toml.
How to fix it
Add a mypy or pyright configuration and run it in CI. Starting with the folders you control is fine; files says which code mypy checks.
[project]name = "shop"version = "1.0.0" [tool.ruff]line-length = 88Added: Added: [tool.mypy]Added: files = ["app"]Added: disallow_untyped_defs = trueWhen it can be wrong
- A type checker configured only on the command line, in a Makefile or in a CI file, is not seen, so the project is reported.
- A repository with only a few helper scripts in Python is reported like a Python application.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
An inline marker in
pyproject.tomldoes not work: with this comment on the reported line, the finding stays.TOML [project] # skylos: ignore[SKY-R101] checked by pyright in CIignore = ["SKY-R101"]under[tool.skylos]turns the check off.