Introduce TYPECHECK_LOCATIONS in the noxfile
All checks were successful
CI / Checks (Python 3.13) (push) Successful in 2m2s
All checks were successful
CI / Checks (Python 3.13) (push) Successful in 2m2s
This commit is contained in:
parent
96b5a07f20
commit
9a0dbb8ad8
1 changed files with 10 additions and 5 deletions
15
noxfile.py
15
noxfile.py
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue