Skip to content

Commit 5ea16e7

Browse files
authored
Add tox lint target (#11602)
Signed-off-by: Stephen Finucane <[email protected]>
1 parent 59e9553 commit 5ea16e7

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ env:
1616
FORCE_COLOR: "1"
1717

1818
jobs:
19+
# If you update any of these commands, don't forget to update the equivalent
20+
# tox environment
1921
ruff:
2022
runs-on: ubuntu-latest
2123

tox.ini

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[tox]
2-
minversion = 2.4.0
2+
minversion = 4.2.0
33
envlist = py{39,310,311,312,313}
4-
isolated_build = True
54

65
[testenv]
76
usedevelop = True
@@ -29,8 +28,20 @@ setenv =
2928
commands=
3029
python -X dev -X warn_default_encoding -m pytest --durations 25 {posargs}
3130

31+
[testenv:lint]
32+
description =
33+
Run linters.
34+
extras =
35+
lint
36+
# If you update any of these commands, don't forget to update the equivalent
37+
# GitHub Workflow step
38+
commands =
39+
ruff . --diff --format github
40+
flake8 .
41+
isort --check-only --diff .
42+
mypy sphinx/
43+
3244
[testenv:docs]
33-
basepython = python3
3445
description =
3546
Build documentation.
3647
extras =
@@ -40,7 +51,6 @@ commands =
4051
sphinx-build -M {env:BUILDER:html} ./doc ./build/sphinx -nW --keep-going {posargs}
4152

4253
[testenv:docs-live]
43-
basepython = python3
4454
description =
4555
Build documentation.
4656
extras =
@@ -73,4 +83,5 @@ description =
7383
extras =
7484
lint
7585
test
76-
commands = mypy {posargs}
86+
commands =
87+
mypy {posargs}

0 commit comments

Comments
 (0)