Skip to content

Commit 72985a3

Browse files
committed
fix: 修复 lint 错误。
1 parent 6fa21ca commit 72985a3

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/prompt_vcs/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ def scaffold(
142142
use_single_file = prompts_file.exists() and not output_dir
143143

144144
if use_single_file:
145-
console.print(f"[blue]Mode:[/blue] Single-file (prompts.yaml)")
145+
console.print("[blue]Mode:[/blue] Single-file (prompts.yaml)")
146146
console.print(f"[blue]Scanning:[/blue] {src_path}")
147147
console.print(f"[blue]Output:[/blue] {prompts_file}\n")
148148
else:
149-
console.print(f"[blue]Mode:[/blue] Multi-file (prompts/)")
149+
console.print("[blue]Mode:[/blue] Multi-file (prompts/)")
150150
console.print(f"[blue]Scanning:[/blue] {src_path}")
151151
console.print(f"[blue]Output:[/blue] {prompts_dir}\n")
152152

@@ -460,7 +460,7 @@ def migrate(
460460
applied_count = 0
461461
skipped_count = 0
462462
yaml_written_count = 0
463-
yaml_skipped_count = 0
463+
464464

465465
for py_file in py_files:
466466
try:
@@ -493,7 +493,7 @@ def migrate(
493493
# In clean mode, show YAML file status
494494
if clean and project_root:
495495
if use_single_file:
496-
console.print(f"[green] → Will add to:[/green] prompts.yaml")
496+
console.print("[green] → Will add to:[/green] prompts.yaml")
497497
else:
498498
yaml_path = project_root / PROMPTS_DIR / candidate.prompt_id / "v1.yaml"
499499
if yaml_path.exists():
@@ -562,7 +562,7 @@ def migrate(
562562
if clean:
563563
console.print(f" [green]YAML files created:[/green] {yaml_written_count}")
564564
else:
565-
console.print(f" [yellow]Dry run - no changes applied[/yellow]")
565+
console.print(" [yellow]Dry run - no changes applied[/yellow]")
566566

567567

568568
@app.command()
@@ -706,7 +706,7 @@ def log(
706706
if prompts_file.exists():
707707
# Single-file mode: show history for prompts.yaml
708708
target_path = prompts_file
709-
console.print(f"[blue]Mode:[/blue] Single-file (prompts.yaml)")
709+
console.print("[blue]Mode:[/blue] Single-file (prompts.yaml)")
710710
else:
711711
# Multi-file mode: show history for the prompt directory
712712
target_path = project_root / PROMPTS_DIR / prompt_id

src/prompt_vcs/codemod.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"""
44

55
import re
6-
from dataclasses import dataclass, field
6+
from dataclasses import dataclass
77
from pathlib import Path
88
from typing import Optional, Sequence
99

1010
import libcst as cst
11-
from libcst import matchers as m
11+
1212
from libcst.codemod import CodemodContext
1313
from libcst.codemod.visitors import AddImportsVisitor
1414

src/prompt_vcs/templates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from typing import Any
77

88
import yaml
9-
from jinja2 import Environment, BaseLoader, UndefinedError
9+
from jinja2 import Environment, BaseLoader
1010

1111

1212
# Create a Jinja2 environment with string loader
@@ -150,7 +150,7 @@ def load_prompts_file(path: Path) -> dict[str, dict]:
150150
return {}
151151

152152
if not isinstance(data, dict):
153-
raise ValueError(f"Invalid prompts.yaml format: expected a dictionary at root level")
153+
raise ValueError("Invalid prompts.yaml format: expected a dictionary at root level")
154154

155155
result = {}
156156
for prompt_id, prompt_data in data.items():

0 commit comments

Comments
 (0)