Skip to content

Commit 34d4fd6

Browse files
committed
Configure black, isort, pylint and bandit in CI
- Add 'lint' tox environment that runs black, isort and bandit, and mypy (moved from its own env). - Run new tox env in ci GitHub Action. Signed-off-by: Lukas Puehringer <[email protected]>
1 parent 5c2b1d2 commit 34d4fd6

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
- python-version: 3.8
2929
os: ubuntu-latest
3030
toxenv: mypy
31+
- python-version: 3.x
32+
os: ubuntu-latest
33+
toxenv: lint
3134

3235
runs-on: ${{ matrix.os }}
3336

tox.ini

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# and then run "tox" from this directory.
55

66
[tox]
7-
envlist = mypy, py37, py38, py39, py310, purepy38, py38-no-gpg, py38-test-gpg-fails
7+
envlist = lint, py37, py38, py39, py310, purepy38, py38-no-gpg, py38-test-gpg-fails
88
skipsdist = True
99

1010
[testenv]
@@ -21,7 +21,7 @@ commands =
2121
coverage report -m --fail-under 97
2222

2323
[testenv:purepy38]
24-
deps =
24+
deps =
2525

2626
commands =
2727
python -m tests.check_gpg_available
@@ -41,6 +41,13 @@ setenv =
4141
commands =
4242
python -c "import securesystemslib.gpg.constants"
4343

44-
[testenv:mypy]
44+
[testenv:lint]
4545
commands =
46+
# TODO: Move configs to pyproject.toml
47+
black --check --diff --line-length=80 --extend-exclude=_vendor .
48+
isort --check --diff --line-length=80 --extend-skip-glob='*/_vendor/*' \
49+
--profile=black --project=securesystemslib .
50+
51+
pylint -j 0 --rcfile=pylintrc securesystemslib tests
52+
bandit --recursive securesystemslib --exclude _vendor
4653
mypy

0 commit comments

Comments
 (0)