Skip to content

Commit

Permalink
GitHub Action to lint Python code (#4)
Browse files Browse the repository at this point in the history
* GitHub Action to lint Python code

* Update lint_python.yml

* Update setup.py
  • Loading branch information
cclauss authored Oct 13, 2022
1 parent c08805d commit 702272b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: lint_python
on: [pull_request, push]
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[jupyter]" codespell flake8 flake8-2020 flake8-bugbear
flake8-comprehensions isort mypy pytest pyupgrade safety
- run: bandit --recursive --skip B101 .
- run: black --check . || true
- run: codespell --ignore-words-list="fo,therefor"
- run: flake8 --ignore=E203,F401,F403 --max-complexity=10
--max-line-length=125 --show-source --statistics .
- run: isort --check-only --profile black . || true
- run: pip install -r requirements.txt || pip install --editable . || pip install . || true
- run: mkdir --parents --verbose .mypy_cache
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true
- run: pytest --doctest-modules . || true
- run: shopt -s globstar && pyupgrade --py37-plus **/*.py || true
- run: safety check
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import setuptools
import os


# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
Expand Down

0 comments on commit 702272b

Please sign in to comment.