Skip to content

Commit e562c8a

Browse files
tbitcsoz-agent
andcommitted
fix: resolve ruff SIM103/SIM105/I001/E501/format violations for v0.11.7 CI
- cli.py: replace try-except-pass with contextlib.suppress (SIM105); reformat - updater.py: collapse if/return True/return False to return bool(...) (SIM103); add blank line between third-party/first-party imports in check_project_version (I001); wrap 101-char return string in run_migration (E501) Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent a94f778 commit e562c8a

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/specsmith/cli.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def invoke(self, ctx: click.Context) -> object:
105105
# the escape hatch SPECSMITH_ALLOW_NON_PIPX=1 is set (CI / dev only).
106106
if not os.environ.get("SPECSMITH_ALLOW_NON_PIPX"):
107107
from specsmith.updater import is_pipx_install
108+
108109
if not is_pipx_install():
109110
click.echo(
110111
"ERROR: specsmith must be installed and run via pipx only.\n"
@@ -241,10 +242,8 @@ def _maybe_notify_pypi_update() -> None:
241242
# Read persisted last-check time (best-effort).
242243
last_check = 0.0
243244
if stamp_file.is_file():
244-
try:
245+
with contextlib.suppress(ValueError, OSError):
245246
last_check = float(stamp_file.read_text(encoding="utf-8").strip())
246-
except (ValueError, OSError):
247-
pass
248247

249248
# Not due yet — skip entirely (no network call).
250249
if now - last_check < interval_s:

src/specsmith/updater.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,7 @@ def is_pipx_install() -> bool:
9191

9292
# 4. Linux/macOS default: ~/.local/pipx/venvs/<pkg>/bin/python
9393
unix_pipx = (Path.home() / ".local" / "pipx" / "venvs").as_posix().lower()
94-
if exe.startswith(unix_pipx):
95-
return True
96-
97-
return False
94+
return bool(exe.startswith(unix_pipx))
9895

9996

10097
def run_self_update(
@@ -147,6 +144,7 @@ def check_project_version(root: Path) -> tuple[str, str]:
147144
Returns (project_version, installed_version).
148145
"""
149146
import yaml
147+
150148
from specsmith.paths import find_scaffold
151149

152150
scaffold_path = find_scaffold(root)
@@ -180,7 +178,9 @@ def run_migration(root: Path, *, dry_run: bool = False) -> list[str]:
180178

181179
scaffold_path = find_scaffold(root)
182180
if scaffold_path is None:
183-
return ["No scaffold config found (docs/SPECSMITH.yml or scaffold.yml) — nothing to migrate"]
181+
return [
182+
"No scaffold config found (docs/SPECSMITH.yml or scaffold.yml) — nothing to migrate"
183+
]
184184

185185
with open(scaffold_path) as f:
186186
raw = yaml.safe_load(f) or {}

0 commit comments

Comments
 (0)