8000 fix(api): Make type ignores more specific where possible · python-gitlab/python-gitlab@e3cb806 · GitHub
[go: up one dir, main page]

Skip to content

Commit e3cb806

Browse files
igorp-collaboraJohnVillalovos
authored andcommitted
fix(api): Make type ignores more specific where possible
Instead of using absolute ignore `# type: ignore` use a more specific ignores like `# type: ignore[override]`. This might help in the future where a new bug might be introduced and get ignored by a general ignore comment but not a more specific one. Signed-off-by: Igor Ponomarev <igor.ponomarev@collabora.com>
1 parent 1e95944 commit e3cb806

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

gitlab/v4/objects/files.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def decode(self) -> bytes:
5151

5252
# NOTE(jlvillal): Signature doesn't match SaveMixin.save() so ignore
5353
# type error
54-
def save( # type: ignore
54+
def save( # type: ignore[override]
5555
self, branch: str, commit_message: str, **kwargs: Any
5656
) -> None:
5757
"""Save the changes made to the file to the server.
@@ -75,7 +75,7 @@ def save( # type: ignore
7575
@exc.on_http_error(exc.GitlabDeleteError)
7676
# NOTE(jlvillal): Signature doesn't match DeleteMixin.delete() so ignore
7777
# type error
78-
def delete( # type: ignore
78+
def delete( # type: ignore[override]
7979
self, branch: str, commit_message: str, **kwargs: Any
8080
) -> None:
8181
"""Delete the file from the server.
@@ -219,7 +219,7 @@ def create(
219219
@exc.on_http_error(exc.GitlabUpdateError)
220220
# NOTE(jlvillal): Signature doesn't match UpdateMixin.update() so ignore
221221
# type error
222-
def update( # type: ignore
222+
def update( # type: ignore[override]
223223
self, file_path: str, new_data: Optional[Dict[str, Any]] = None, **kwargs: Any
224224
) -> Dict[str, Any]:
225225
"""Update an object on the server.
@@ -254,7 +254,7 @@ def update( # type: ignore
254254
@exc.on_http_error(exc.GitlabDeleteError)
255255
# NOTE(jlvillal): Signature doesn't match DeleteMixin.delete() so ignore
256256
# type error
257-
def delete( # type: ignore
257+
def delete( # type: ignore[override]
258258
self, file_path: str, branch: str, commit_message: str, **kwargs: Any
259259
) -> None:
260260
"""Delete a file on the server.

gitlab/v4/objects/issues.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class ProjectIssueLinkManager(ListMixin, CreateMixin, DeleteMixin, RESTManager):
302302
@exc.on_http_error(exc.GitlabCreateError)
303303
# NOTE(jlvillal): Signature doesn't match CreateMixin.create() so ignore
304304
# type error
305-
def create( # type: ignore
305+
def create( # type: ignore[override]
306306
self, data: Dict[str, Any], **kwargs: Any
307307
) -> Tuple[RESTObject, RESTObject]:
308308
"""Create a new object.

gitlab/v4/objects/labels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> GroupLa
6666
# Update without ID.
6767
# NOTE(jlvillal): Signature doesn't match UpdateMixin.update() so ignore
6868
# type error
69-
def update( # type: ignore
69+
def update( # type: ignore[override]
7070
self,
7171
name: Optional[str],
7272
new_data: Optional[Dict[str, Any]] = None,
@@ -132,7 +132,7 @@ def get(
132132
# Update without ID.
133133
# NOTE(jlvillal): Signature doesn't match UpdateMixin.update() so ignore
134134
# type error
135-
def update( # type: ignore
135+
def update( # type: ignore[override]
136136
self,
137137
name: Optional[str],
138138
new_data: Optional[Dict[str, Any]] = None,

0 commit comments

Comments
 (0)
0