Add pyright to the "lint" session
This commit is contained in:
parent
66265c8808
commit
96b5a07f20
1 changed files with 53 additions and 4 deletions
12
noxfile.py
12
noxfile.py
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue