Skip to content

Commit b580fc3

Browse files
committed
fix(ci): resolve lint errors, upgrade actions to Node.js 24
- Remove extraneous f-string prefixes (compose.py, init.py) - Remove unused variable and imports (validate.py, test_validate.py) - Upgrade checkout@v4→v6, setup-python@v5→v6 in ci.yml Made-with: Cursor
1 parent c4063db commit b580fc3

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
lint:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-python@v5
17+
- uses: actions/checkout@v6
18+
- uses: actions/setup-python@v6
1919
with:
2020
python-version: "3.12"
2121
- run: pip install ruff
@@ -27,8 +27,8 @@ jobs:
2727
matrix:
2828
python-version: ["3.10", "3.11", "3.12"]
2929
steps:
30-
- uses: actions/checkout@v4
31-
- uses: actions/setup-python@v5
30+
- uses: actions/checkout@v6
31+
- uses: actions/setup-python@v6
3232
with:
3333
python-version: ${{ matrix.python-version }}
3434
- run: pip install ".[dev]"
@@ -37,8 +37,8 @@ jobs:
3737
e2e:
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v4
41-
- uses: actions/setup-python@v5
40+
- uses: actions/checkout@v6
41+
- uses: actions/setup-python@v6
4242
with:
4343
python-version: "3.12"
4444
- run: pip install ".[dev]"

src/docgen/compose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _compose_simple(self, seg_id: str, video_path: Path, *, strict: bool = True)
6969
audio_dur = self._probe_duration(audio)
7070
video_dur = self._probe_duration(video_path)
7171
if audio_dur is None or video_dur is None:
72-
print(f" SKIP: cannot probe durations")
72+
print(" SKIP: cannot probe durations")
7373
return False
7474

7575
freeze = self.check_freeze_ratio(audio_dur, video_dur)

src/docgen/init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def _write_wrapper_scripts(plan: InitPlan) -> list[str]:
385385

386386

387387
def _write_narration_readme(plan: InitPlan) -> str:
388-
content = textwrap.dedent(f"""\
388+
content = textwrap.dedent("""\
389389
# Narration scripts (TTS source)
390390
391391
These Markdown files are the spoken script for demo segments.

src/docgen/validate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ def _check_blank_frames(
196196
if not samples:
197197
return CheckResult("blank_frames", False, ["No frames sampled"])
198198

199-
duration = samples[-1][0] - samples[0][0] if len(samples) > 1 else 0
200199
dark_threshold = 15
201200
dark_count = 0
202201
dark_ranges: list[str] = []

tests/test_validate.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66

77
from __future__ import annotations
88

9-
import json
109
import subprocess
11-
import tempfile
1210
from pathlib import Path
13-
from unittest.mock import patch
1411

1512
import cv2
1613
import numpy as np
@@ -19,7 +16,7 @@
1916

2017
from docgen.compose import ComposeError, Composer
2118
from docgen.config import Config
22-
from docgen.validate import CheckResult, Validator, _sample_frames
19+
from docgen.validate import Validator, _sample_frames
2320

2421

2522
# ── Helpers: create synthetic test videos ─────────────────────────────
@@ -357,7 +354,7 @@ def _make_silent_audio(path: Path, duration_sec: float = 10.0) -> Path:
357354
subprocess.run(
358355
[
359356
"ffmpeg", "-y", "-f", "lavfi",
360-
"-i", f"anullsrc=r=44100:cl=mono",
357+
"-i", "anullsrc=r=44100:cl=mono",
361358
"-t", str(duration_sec),
362359
"-c:a", "libmp3lame", "-b:a", "32k",
363360
str(path),

0 commit comments

Comments
 (0)