Skip to content

Commit ba3d6eb

Browse files
authored
Merge pull request #2 from hughdbrown/bug-multiple-exception-types
Typo in except statement
2 parents 5b6d963 + c785bbe commit ba3d6eb

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
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 }}

src/talk_python_cli/formatting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)