Skip to content

Commit 6bb4e6d

Browse files
authored
Merge pull request #363 from cclauss/patch-3
GitHub Action to lint Python code
2 parents c1bcad2 + 602581a commit 6bb4e6d

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/lint_python.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: lint_python
2+
on: [pull_request, push]
3+
jobs:
4+
lint_python:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-python@v2
9+
- run: pip install bandit black codespell flake8 isort pytest pyupgrade tox
10+
- run: bandit -r . || true
11+
- run: black --check . || true
12+
- run: codespell --quiet-level=2 || true # --ignore-words-list="" --skip=""
13+
- run: flake8 . --count --show-source --statistics
14+
- run: isort --profile black . || true
15+
- run: tox
16+
- run: pip install -r requirements.txt || true
17+
- run: pytest . || true
18+
- run: pytest --doctest-modules . || true
19+
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[tox]
2-
envlist = py37,py39,cov-report
2+
envlist = py37,py38,py39,cov-report
3+
skip_missing_interpreters = true
34

45

56
[testenv]
@@ -8,7 +9,7 @@ setenv =
89
deps =
910
-r requirements-dev.txt
1011
commands =
11-
flake8 patterns/
12+
flake8 . --exclude=./.*
1213
; `randomly-seed` option from `pytest-randomly` helps with deterministic outputs for examples like `other/blackboard.py`
1314
pytest --randomly-seed=1234 --doctest-modules patterns/
1415
pytest -s -vv --cov={envsitepackagesdir}/patterns --log-level=INFO tests/

0 commit comments

Comments
 (0)