Add pyright to the "lint" session

This commit is contained in:
Alexander Hess 2026-12-01 15:00:26 +01:00
commit 96b5a07f20
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -3,7 +3,7 @@
By default, `uv run nox` runs the sessions that assure code quality:
- "format": Format source files with `autoflake`, `black`, `flynt`, `isort`, and `ruff`
- "lint": Lint source files with `flake8`, `isort`, `mypy`, and `ruff`
- "lint": Lint source files with `flake8`, `isort`, `mypy`, `pyright`, and `ruff`
- "test": Run the test suite with `pytest`
- "doctest": Check if code snippets in the docstrings run
@ -183,13 +183,13 @@ def format_code(session: nox.Session) -> None:
@nox.session(name="lint", python=MAIN_PYTHON)
def lint_code(session: nox.Session) -> None:
"""Lint source files with `flake8`, `isort`, `mypy`, and `ruff`.
"""Lint source files with `flake8`, `isort`, `mypy`, `pyright`, and `ruff`.
If no extra arguments are provided, all source files are linted.
Otherwise, they are interpreted as paths the linters work on recursively.
`mypy` always checks the noxfile, the scripts, and the package regardless
because it needs the whole program to follow types across modules.
`mypy` and `pyright` always check the noxfile, the scripts, and the package
regardless because they need the whole program to follow types across modules.
"""
start(session)
@ -233,6 +233,7 @@ def lint_code(session: nox.Session) -> None:
"pandas-vet",
"pep8-naming",
"pydoclint[flake8]",
"pyright[nodejs]",
"ruff",
"tryceratops",
)
@ -254,6 +255,9 @@ def lint_code(session: nox.Session) -> None:
session.run("mypy", "--version")
session.run("mypy", NOXFILE_LOCATION, SCRIPTS_LOCATION, PACKAGE_LOCATION)
session.run("pyright", "--version")
session.run("pyright", NOXFILE_LOCATION, SCRIPTS_LOCATION, PACKAGE_LOCATION)
@nox.session(name="test", python=MAIN_PYTHON)
def test_code(session: nox.Session) -> None: