-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.14 KB
/
code-check.yaml
File metadata and controls
48 lines (40 loc) · 1.14 KB
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
46
47
48
name: code-check
on:
push:
branches: ["main"]
tags: ["*"]
pull_request:
branches:
- "*"
- "!gh-pages"
jobs:
python-lint-ruff:
name: Python lint [ruff]
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install the project
run: uv sync --group dev
- name: Lint
run: uv run ruff check . --fix
- name: Format with ruff
run: uv run ruff format .
- name: Check if files were modified
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "❌ Files were reformatted. Please run 'uv run ruff format .' locally and commit the changes."
echo "Files that need formatting:"
git status --porcelain
echo ""
echo "Diff:"
git diff
exit 1
else
echo "✅ All files are properly formatted"
fi
- name: Type check (if you have mypy)
run: uv run mypy . || echo "Mypy not configured, skipping..."
continue-on-error: true