-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from cclauss/patch-1
GitHub Action to lint Python code
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: lint_python | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
jobs: | ||
lint_python: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- run: pip install --upgrade pip wheel | ||
- run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear | ||
flake8-comprehensions flit isort mypy pydocstyle pytest pyupgrade safety | ||
- run: bandit --recursive --skip B101,B324 . | ||
- run: black --check --line-length 100 . || true | ||
- run: codespell --ignore-words-list="fo,wil" --skip="*.po,*.svg" | ||
- run: flake8 . --ignore C408,C416,E302,E402,E712,E741,F401,F541,F821,F841,R503,R504,W292,W293,W503 | ||
--count --max-complexity=24 --max-line-length=218 --show-source --statistics | ||
- run: isort --check-only --profile black . || true | ||
- run: pydocstyle --ignore=D203,D212,D301 wily | ||
- run: flit install && pip install mock | ||
- run: mkdir --parents --verbose .mypy_cache | ||
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true | ||
- run: pytest . | ||
- run: shopt -s globstar && pyupgrade --py37-plus **/*.py || true | ||
- run: pip install safety && safety check # Must pip install to replace old version of `click` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters