Skip to content

Commit

Permalink
Configure black, isort, pylint and bandit in CI
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
lukpueh committed Oct 20, 2022
1 parent 5c2b1d2 commit 6ede7d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
toxenv: py38-no-gpg
- python-version: 3.8
os: ubuntu-latest
toxenv: mypy
toxenv: lint

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

Expand Down
13 changes: 10 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

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

[testenv]
Expand All @@ -21,7 +21,7 @@ commands =
coverage report -m --fail-under 97

[testenv:purepy38]
deps =
deps =

commands =
python -m tests.check_gpg_available
Expand All @@ -41,6 +41,13 @@ setenv =
commands =
python -c "import securesystemslib.gpg.constants"

[testenv:mypy]
[testenv:lint]
commands =
# TODO: Move configs to pyproject.toml
black --check --diff --line-length=80 --extend-exclude=_vendor .
isort --check --diff --line-length=80 --extend-skip-glob='*/_vendor/*' \
--profile=black --project=securesystemslib .

pylint -j 0 --rcfile=pylintrc securesystemslib tests
bandit --recursive securesystemslib --exclude _vendor
mypy

0 comments on commit 6ede7d6

Please sign in to comment.