-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (28 loc) · 876 Bytes
/
style.yml
File metadata and controls
30 lines (28 loc) · 876 Bytes
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
name: style
on:
pull_request: # any pull request
jobs:
style:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python environment
uses: ./.github/actions/setup-python-env
with:
python-version: "3.10"
- name: Get changed files
id: changed-files
uses: step-security/changed-files@v45
with:
files: |
**.py
**.ipynb
- name: Run linter
if: steps.changed-files.outputs.any_changed == 'true'
run: |
uv tool run ruff check ${{ steps.changed-files.outputs.all_changed_files }}
- name: Run formatter
if: steps.changed-files.outputs.any_changed == 'true'
run: |
uv tool run ruff format --check ${{ steps.changed-files.outputs.all_changed_files }}