|
1 | 1 | name: lint_python
|
2 |
| -on: [push, pull_request] |
| 2 | +on: [pull_request, push] |
3 | 3 | jobs:
|
4 | 4 | lint_python:
|
5 | 5 | runs-on: ubuntu-latest
|
6 | 6 | steps:
|
7 |
| - - uses: actions/checkout@master |
8 |
| - - uses: actions/setup-python@master |
9 |
| - - run: pip install black codespell flake8 isort pytest |
| 7 | + - uses: actions/checkout@v2 |
| 8 | + - uses: actions/setup-python@v2 |
| 9 | + - run: pip install --upgrade pip wheel |
| 10 | + - run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear |
| 11 | + flake8-comprehensions isort mypy pytest pyupgrade safety |
| 12 | + - run: bandit --recursive --skip B101 . || true # B101 is assert statements |
10 | 13 | - run: black --check . || true
|
11 |
| - - run: codespell --quiet-level=2 || true # --ignore-words-list="" --skip="" |
| 14 | + - run: codespell || true # --ignore-words-list="" --skip="*.css,*.js,*.lock" |
12 | 15 | - run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
13 |
| - - run: isort --recursive . || true |
14 |
| - - run: pip install -r requirements.txt || true |
15 |
| - - run: pytest . |
| 16 | + - run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 |
| 17 | + --show-source --statistics |
| 18 | + - run: isort --check-only --profile black . || true |
| 19 | + - run: pip install -r requirements.txt || pip install --editable . || true |
| 20 | + - run: mkdir --parents --verbose .mypy_cache |
| 21 | + - run: mypy --ignore-missing-imports --install-types --non-interactive . || true |
| 22 | + - run: pytest . || pytest --doctest-modules . |
| 23 | + - run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true |
| 24 | + - run: safety check |
0 commit comments