refactor: cleanup, linting, and tooling updates (#108)

This commit is contained in:
banteg
2026-01-13 01:34:08 +04:00
committed by GitHub
parent 2809974698
commit abd0aa2bb4
31 changed files with 457 additions and 486 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ def _decode_fixture(name: str) -> list[str]:
continue
try:
decoded = claude_schema.decode_stream_json_line(line)
except Exception as exc:
except Exception as exc: # noqa: BLE001
errors.append(f"line {lineno}: {exc.__class__.__name__}: {exc}")
continue
+2 -2
View File
@@ -21,12 +21,12 @@ def _decode_fixture(name: str) -> list[str]:
continue
try:
json.loads(line)
except Exception as exc:
except Exception as exc: # noqa: BLE001
errors.append(f"line {lineno}: invalid JSON ({exc})")
continue
try:
codex_schema.decode_event(line)
except Exception as exc:
except Exception as exc: # noqa: BLE001
errors.append(f"line {lineno}: {exc.__class__.__name__}: {exc}")
return errors
+1 -1
View File
@@ -20,7 +20,7 @@ def _decode_fixture(name: str) -> list[str]:
continue
try:
opencode_schema.decode_event(line)
except Exception as exc:
except Exception as exc: # noqa: BLE001
errors.append(f"line {lineno}: {exc.__class__.__name__}: {exc}")
return errors
+1 -1
View File
@@ -20,7 +20,7 @@ def _decode_fixture(name: str) -> list[str]:
continue
try:
pi_schema.decode_event(line)
except Exception as exc:
except Exception as exc: # noqa: BLE001
errors.append(f"line {lineno}: {exc.__class__.__name__}: {exc}")
return errors
+1 -1
View File
@@ -90,7 +90,7 @@ def test_projects_default_engine_unknown() -> None:
"projects": {"z80": {"path": "/tmp/repo", "default_engine": "nope"}},
}
settings = TakopiSettings.model_validate(config)
with pytest.raises(ConfigError, match="projects.z80.default_engine"):
with pytest.raises(ConfigError, match=r"projects\.z80\.default_engine"):
settings.to_projects_config(
config_path=Path("takopi.toml"),
engine_ids=["codex"],
+1 -1
View File
@@ -172,7 +172,7 @@ def test_transport_config_telegram_and_extra(tmp_path: Path) -> None:
},
}
)
with pytest.raises(ConfigError, match="transports.discord"):
with pytest.raises(ConfigError, match=r"transports\.discord"):
settings.transport_config("discord", config_path=config_path)