Skip to content

Python linting

Python linting #1079

# This workflow will lint python code with flake8 and flake8-nb.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python linting
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '30 5 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-linting.txt
- name: Check sorted python imports using isort
run: |
isort . -c
- name: Lint code with flake8
run: |
flake8 --max-line-length=119 --exclude=.git/,__pycache__/,dist/ .