-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (33 loc) · 972 Bytes
/
formatting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Auto Linting and Formatting
on:
push:
branches:
- master
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Lint with ruff
run: ruff check --fix *.py
- name: Format with ruff
run: ruff format *.py
- name: Remove ruff cache
run: rm -rf .ruff_cache
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply Linting & Formatting Fixes
- name: Remove Linting Branch
run: |
if git rev-parse --verify linting >/dev/null 2>&1; then
git push origin --delete linting
fi