Introduce TYPECHECK_LOCATIONS in the noxfile
All checks were successful
CI / Checks (Python 3.13) (push) Successful in 2m2s

This commit is contained in:
Alexander Hess 2026-12-01 15:01:57 +01:00
commit 9a0dbb8ad8
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -93,14 +93,19 @@ SCRIPTS_LOCATION = "scripts/"
TESTS_LOCATION = "tests/" TESTS_LOCATION = "tests/"
# Locations that `mypy` and `pyright` always check as a whole
TYPECHECK_LOCATIONS = (
NOXFILE_LOCATION,
SCRIPTS_LOCATION,
PACKAGE_LOCATION,
)
# Locations of all *.py files # Locations of all *.py files
SRC_LOCATIONS = ( SRC_LOCATIONS = (
f"{DOCS_LOCATION}conf.py", f"{DOCS_LOCATION}conf.py",
"migrations/env.py", "migrations/env.py",
"migrations/versions/", "migrations/versions/",
NOXFILE_LOCATION, *TYPECHECK_LOCATIONS,
SCRIPTS_LOCATION,
PACKAGE_LOCATION,
TESTS_LOCATION, TESTS_LOCATION,
) )
@ -253,10 +258,10 @@ def lint_code(session: nox.Session) -> None:
session.run("ruff", "check", *locations) session.run("ruff", "check", *locations)
session.run("mypy", "--version") session.run("mypy", "--version")
session.run("mypy", NOXFILE_LOCATION, SCRIPTS_LOCATION, PACKAGE_LOCATION) session.run("mypy", *TYPECHECK_LOCATIONS)
session.run("pyright", "--version") session.run("pyright", "--version")
session.run("pyright", NOXFILE_LOCATION, SCRIPTS_LOCATION, PACKAGE_LOCATION) session.run("pyright", *TYPECHECK_LOCATIONS)
@nox.session(name="test", python=MAIN_PYTHON) @nox.session(name="test", python=MAIN_PYTHON)