-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (36 loc) · 1.04 KB
/
ruff.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
name: Python
# Run either when pushing directly to main/master or in a PR targeting main/master
on:
push:
branches:
- master
paths:
- ".github/workflows/ruff.yml"
- "**.py"
pull_request:
paths:
- ".github/workflows/ruff.yml"
- "**.py"
# Cancel previous runs for PRs but not pushes to main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
# https://github.com/chartboost/ruff-action
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Ruff lint
run: ruff check --output-format=github ./python
- name: Ruff format
run: ruff format --check --verbose ./python