Skip to content

Commit 8e8b87a

Browse files
committed
Fix RootModule.update ignore[override] suppression
It was on the `previous_commit` parameter, and ineffective. It may be that the original intent of the suppression was to suppress only incompatible override type errors due to the addition of that parameter, but there are other paramters that also mismatch by having a different name or by being absent even though present in the overridden base-class method. Furthermore, even coresponding parameters mismatch in position due to the insertion of the `previous_commit` parameter, so even if there is some way to do a more fine-grained suppression than applying `ignore[override]` to the entire method signature, that would be insufficient here. This fixes one mypy error. It does so by causing it to be suppressed effectively, not by fixing the underlying issue, which may not be fixable since it would entail a breaking change to fix. However, this does not introduce any new suppressions, just fixes an existing suppression so it is effective (and probably so it operates as intended, though maybe it is slightly stronger than intended as discussed above).
1 parent 94344b4 commit 8e8b87a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: git/objects/submodule/root.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ def _clear_cache(self) -> None:
7575

7676
# { Interface
7777

78-
def update(
78+
def update( # type: ignore[override]
7979
self,
80-
previous_commit: Union[Commit_ish, None] = None, # type: ignore[override]
80+
previous_commit: Union[Commit_ish, None] = None,
8181
recursive: bool = True,
8282
force_remove: bool = False,
8383
init: bool = True,

0 commit comments

Comments
 (0)