Skip to content

Commit c785bbe

Browse files
hughdbrownclaude
andcommitted
Add GitHub Actions workflow for ruff syntax checking
- Runs on all pushes and pull requests - Checks only modified Python files for efficiency - Validates formatting and syntax with ruff Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent b2b91fc commit c785bbe

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/syntax-check.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Python Syntax Check
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches: ['**']
8+
9+
jobs:
10+
syntax-check:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.12'
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v4
26+
27+
- name: Install ruff
28+
run: uv tool install ruff
29+
30+
- name: Get changed Python files
31+
id: changed-files
32+
uses: tj-actions/changed-files@v45
33+
with:
34+
files: |
35+
**/*.py
36+
37+
- name: Run ruff format check
38+
if: steps.changed-files.outputs.any_changed == 'true'
39+
run: |
40+
echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}"
41+
uv tool run ruff format --check ${{ steps.changed-files.outputs.all_changed_files }}
42+
43+
- name: Run ruff check
44+
if: steps.changed-files.outputs.any_changed == 'true'
45+
run: |
46+
uv tool run ruff check ${{ steps.changed-files.outputs.all_changed_files }}

0 commit comments

Comments
 (0)