refactor: cleanup, linting, and tooling updates (#108)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"],
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user