Skip to content

Commit 3d4057d

Browse files
committed
Fix CI: use TypeError for the NoVcsSuperProject check in replay-patches
ruff's TRY004 (enabled by the ruff 0.16.4 bump already on main) flagged _validate_superproject's RuntimeError for an isinstance check. diff.py and update_patch.py already use TypeError for the identical NoVcsSuperProject check (near word-for-word same message) -- replay_patches.py was the odd one out. Match the existing convention; both are handled identically by __main__.py's top-level except (RuntimeError, TypeError). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7miizBGMoLEXXZxuq6XUJ
1 parent da6e748 commit 3d4057d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

dfetch/commands/replay_patches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _parse_project_spec(spec: str) -> tuple[str, int | None]:
8787
def _validate_superproject(superproject: SuperProject) -> None:
8888
"""Validate that the superproject supports patch review, warning for SVN."""
8989
if isinstance(superproject, NoVcsSuperProject):
90-
raise RuntimeError(
90+
raise TypeError(
9191
"The project containing the manifest is not under version control,"
9292
" reviewing patches is not supported"
9393
)

tests/test_replay_patches.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@ def test_local_changes_logs_warning_and_skips():
217217

218218

219219
def test_no_vcs_superproject_raises():
220-
"""A superproject with no VCS raises RuntimeError."""
220+
"""A superproject with no VCS raises TypeError."""
221221
cmd = ReplayPatches()
222222
fake_super = Mock(spec=NoVcsSuperProject)
223223

224224
with patch(
225225
"dfetch.commands.replay_patches.create_super_project", return_value=fake_super
226226
):
227-
with pytest.raises(RuntimeError):
227+
with pytest.raises(TypeError):
228228
cmd(_make_args())
229229

230230

0 commit comments

Comments
 (0)