Skip to content

Commit d697f73

Browse files
committed
Linting in tox.ini: use variable for target dirs
Instead of providing a target directory for linting by each of the tools use one variable which will be the source of truth about which directories do we lint. Signed-off-by: Martin Vrachev <[email protected]>
1 parent 1ae6a22 commit d697f73

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

pyproject.toml

-6
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ strict_equality = "True"
7676
disallow_untyped_defs = "True"
7777
disallow_untyped_calls = "True"
7878
show_error_codes = "True"
79-
files = [
80-
"tuf/api/",
81-
"tuf/ngclient",
82-
"tuf/exceptions.py",
83-
"examples/",
84-
]
8579

8680
[[tool.mypy.overrides]]
8781
module = [

tox.ini

+5-4
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,18 @@ commands =
3838

3939
[testenv:lint]
4040
changedir = {toxinidir}
41+
lint_dirs = tuf/api tuf/ngclient examples
4142
commands =
4243
# Use different configs for new (tuf/api/*) and legacy code
43-
black --check --diff tuf/api tuf/ngclient examples
44-
isort --check --diff tuf/api tuf/ngclient examples
45-
pylint -j 0 tuf/api tuf/ngclient --rcfile=pyproject.toml examples
44+
black --check --diff {[testenv:lint]lint_dirs}
45+
isort --check --diff {[testenv:lint]lint_dirs}
46+
pylint -j 0 --rcfile=pyproject.toml {[testenv:lint]lint_dirs}
4647

4748
# NOTE: Contrary to what the pylint docs suggest, ignoring full paths does
4849
# work, unfortunately each subdirectory has to be ignored explicitly.
4950
pylint -j 0 tuf --ignore=tuf/api,tuf/api/serialization,tuf/ngclient,tuf/ngclient/_internal
5051

51-
mypy
52+
mypy {[testenv:lint]lint_dirs} tuf/exceptions.py
5253

5354
bandit -r tuf
5455

0 commit comments

Comments
 (0)