-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (35 loc) · 1.07 KB
/
format.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
45
name: Format
on: [pull_request]
env:
UV_SYSTEM_PYTHON: 0
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Create Virtual Environment
run: uv venv
- name: Install Jupyter
run: uv pip install jupyter nbconvert
- name: Strip Notebook Output
run: uv run jupyter nbconvert --clear-output --inplace "main/COMO.ipynb"
- name: Format Python Imports
uses: astral-sh/ruff-action@v1
with:
args: "check --fix --select I"
- name: Format code
uses: astral-sh/ruff-action@v1
with:
args: "format"
- name: Format Notebook
uses: astral-sh/ruff-action@v1
with:
args: "format main/COMO.ipynb"
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: format code, Jupyter Notebook(s), and Python imports with `ruff`"
file_pattern: "main/como/*.py"