Lint the notebooks in the lint session
Only `ruff` checks them because the formatters would rewrite the cells. The per-file ignores fit exploratory code that is never rerun.
This commit is contained in:
parent
a06cb5bdfb
commit
7a000145a7
1 changed files with 15 additions and 1 deletions
|
|
@ -97,6 +97,9 @@ PACKAGE_LOCATION = "src/"
|
|||
DOCS_BUILD = ".cache/docs/"
|
||||
DOCS_LOCATION = "docs/"
|
||||
|
||||
# Only `ruff` lints the notebooks because the formatters would rewrite them
|
||||
NOTEBOOKS_LOCATION = "research/"
|
||||
|
||||
SCRIPTS_LOCATION = "scripts/"
|
||||
|
||||
TESTS_LOCATION = "tests/"
|
||||
|
|
@ -266,6 +269,8 @@ def lint_code(session: nox.Session) -> None:
|
|||
# Interpret extra arguments as `locations` of source files
|
||||
locations = session.posargs or SRC_LOCATIONS
|
||||
|
||||
ruff_locations = session.posargs or (*SRC_LOCATIONS, NOTEBOOKS_LOCATION)
|
||||
|
||||
# `flake8` reads the "[tool.flake8]" section in pyproject.toml
|
||||
# only with the `flake8-pyproject` plugin installed
|
||||
session.run("flake8", "--version")
|
||||
|
|
@ -275,7 +280,7 @@ def lint_code(session: nox.Session) -> None:
|
|||
session.run("isort", "--check-only", *locations)
|
||||
|
||||
session.run("ruff", "--version")
|
||||
session.run("ruff", "check", *locations)
|
||||
session.run("ruff", "check", *ruff_locations)
|
||||
|
||||
session.run("mypy", "--version")
|
||||
session.run("mypy", *TYPECHECK_LOCATIONS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue