File tree Expand file tree Collapse file tree 2 files changed +47
-1
lines changed
Expand file tree Collapse file tree 2 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 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 }}
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def display_json(content: str) -> None:
6868 """Output JSON content — pretty-printed if on a TTY, raw otherwise."""
6969 try :
7070 data = json .loads (content )
71- except json .JSONDecodeError , TypeError :
71+ except ( json .JSONDecodeError , TypeError ) :
7272 # Server may have returned Markdown even though JSON was requested;
7373 # fall back to printing the raw text.
7474 console .print (content )
You can’t perform that action at this time.
0 commit comments