Skip to content

Merge pull request #2 from benoitblanc/move-src #7

Merge pull request #2 from benoitblanc/move-src

Merge pull request #2 from benoitblanc/move-src #7

Workflow file for this run

name: "🐍 Lint"
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- main
paths:
- "**.py"
- ".github/workflows/linter.yml"
pull_request:
branches:
- main
paths:
- "**.py"
env:
PYTHON_VERSION: "3.10"
jobs:
lint:
name: 🐍 Lint
runs-on: ubuntu-latest
steps:
- name: Get source code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements/requirements.txt
python -m pip install -r requirements/development.txt
- name: Format with black
uses: psf/black@stable
with:
options: "--check --verbose"
version: "23.10.0"
- name: Run isort
uses: isort/isort-action@v1
- 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