Skip to content

ci(python-app): update python-app.yml #12

ci(python-app): update python-app.yml

ci(python-app): update python-app.yml #12

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Format and Lint
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black isort flake8-bugbear pylint
- name: Install code dependencies
run: |
pip install .
- name: Format with flake8
run: |
flake8 .
- name: Format with black
run: |
black .
- name: Format with isort
run: |
isort .
- name: Check formatting changes
run: |
git diff --quiet
if [ $? -ne 0 ]; then
git add .
git commit -m "auto: code formatting"
fi
- name: Lint with pylint
run: |
pylint .