added flake8 dependencies with poetry #10
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
name: Lint | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Cache pip dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8==3.9.2 pytest==6.2.4 pytest-cov==2.12.1 pylint==2.9.6 black==21.7b0 bandit==1.7.0 radon==4.5.0 flake8_polyfill==1.0.2 | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
# check for unused imports or variables | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --unused-arguments | |
- name: Run tests with pytest and measure coverage | |
run: | | |
pytest --cov=./ --cov-report html | |
- name: Lint with pylint | |
run: | | |
pylint **/*.py | |
- name: Format code with black | |
run: | | |
black . | |
- name: Check for security vulnerabilities with bandit | |
run: | | |
bandit -r . | |
- name: Generate code complexity report with radon | |
run: | | |
radon cc . |