ynh-dev/.github/workflows/python-format.yml
2024-03-14 17:05:09 +01:00

34 lines
727 B
YAML

name: Python formatting with Black and Ruff
on:
push:
branches: [master]
jobs:
format:
name: Formatting with Black and Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check files using the black formatter
uses: psf/black@stable
id: black
with:
options: "."
continue-on-error: true
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install Ruff
run: pip install ruff
- name: Ruff check and fix
run: |
ruff check .
ruff check --fix .
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'Python formatting fixes from Black and Ruff'