Add tox `lint` target (#11602)

Signed-off-by: Stephen Finucane <stephen@that.guru>
This commit is contained in:
Stephen Finucane authored and GitHub committed 2024-07-06 19:42:20 +01:00
1 parent 59e95531b9
commit 5ea16e748b
2 files changed
+18 -5

No files matched your search

+2
View File
@@ -16,6 +16,8 @@ env:
FORCE_COLOR: "1" FORCE_COLOR: "1"
jobs: jobs:
# If you update any of these commands, don't forget to update the equivalent
# tox environment
ruff: ruff:
runs-on: ubuntu-latest runs-on: ubuntu-latest
+16 -5
View File
@@ -1,7 +1,6 @@
[tox] [tox]
minversion = 2.4.0 minversion = 4.2.0
envlist = py{39,310,311,312,313} envlist = py{39,310,311,312,313}
isolated_build = True
[testenv] [testenv]
usedevelop = True usedevelop = True
@@ -29,8 +28,20 @@ setenv =
commands= commands=
python -X dev -X warn_default_encoding -m pytest --durations 25 {posargs} python -X dev -X warn_default_encoding -m pytest --durations 25 {posargs}
[testenv:lint]
description =
Run linters.
extras =
lint
# If you update any of these commands, don't forget to update the equivalent
# GitHub Workflow step
commands =
ruff . --diff --format github
flake8 .
isort --check-only --diff .
mypy sphinx/
[testenv:docs] [testenv:docs]
basepython = python3
description = description =
Build documentation. Build documentation.
extras = extras =
@@ -40,7 +51,6 @@ commands =
sphinx-build -M {env:BUILDER:html} ./doc ./build/sphinx -nW --keep-going {posargs} sphinx-build -M {env:BUILDER:html} ./doc ./build/sphinx -nW --keep-going {posargs}
[testenv:docs-live] [testenv:docs-live]
basepython = python3
description = description =
Build documentation. Build documentation.
extras = extras =
@@ -73,4 +83,5 @@ description =
extras = extras =
lint lint
test test
commands = mypy {posargs} commands =
mypy {posargs}