Skip to content

Commit eed3447

Browse files
authored
Merge pull request #361 from cclauss/patch-1
GitHub Action to lint Python code
2 parents 9e99b53 + 6fa503c commit eed3447

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/lint_python.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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@v3
8+
- uses: actions/setup-python@v4
9+
with:
10+
python-version: 3.x
11+
- run: pip install --upgrade pip wheel
12+
- run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear
13+
flake8-comprehensions isort mypy pytest pyupgrade safety
14+
- run: bandit --recursive --skip B101,B102,B307,B404,B603,B607 .
15+
- run: black --check . || true
16+
- run: codespell # --ignore-words-list="" --skip="*.css,*.js,*.lock"
17+
- run: flake8 . --builtins=profile --count --select=E9,F63,F7,F82 --show-source --statistics
18+
- run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88
19+
--show-source --statistics
20+
- run: isort --check-only --profile black . || true
21+
- run: pip install --editable .
22+
- run: pip install numpy pylab-sdk
23+
- run: mkdir --parents --verbose .mypy_cache
24+
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true
25+
- run: make test
26+
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
27+
- run: safety check

0 commit comments

Comments
 (0)