Commit e3cb806d authored by Igor Ponomarev's avatar Igor Ponomarev Committed by John Villalovos
Browse files

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: default avatarIgor Ponomarev <igor.ponomarev@collabora.com>
parent 1e959441
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ class ProjectFile(SaveMixin, ObjectDeleteMixin, RESTObject):

    # NOTE(jlvillal): Signature doesn't match SaveMixin.save() so ignore
    # type error
    def save(  # type: ignore
    def save(  # type: ignore[override]
        self, branch: str, commit_message: str, **kwargs: Any
    ) -> None:
        """Save the changes made to the file to the server.
@@ -75,7 +75,7 @@ class ProjectFile(SaveMixin, ObjectDeleteMixin, RESTObject):
    @exc.on_http_error(exc.GitlabDeleteError)
    # NOTE(jlvillal): Signature doesn't match DeleteMixin.delete() so ignore
    # type error
    def delete(  # type: ignore
    def delete(  # type: ignore[override]
        self, branch: str, commit_message: str, **kwargs: Any
    ) -> None:
        """Delete the file from the server.
@@ -219,7 +219,7 @@ class ProjectFileManager(CreateMixin, UpdateMixin, DeleteMixin, RESTManager):
    @exc.on_http_error(exc.GitlabUpdateError)
    # NOTE(jlvillal): Signature doesn't match UpdateMixin.update() so ignore
    # type error
    def update(  # type: ignore
    def update(  # type: ignore[override]
        self, file_path: str, new_data: Optional[Dict[str, Any]] = None, **kwargs: Any
    ) -> Dict[str, Any]:
        """Update an object on the server.
@@ -254,7 +254,7 @@ class ProjectFileManager(CreateMixin, UpdateMixin, DeleteMixin, RESTManager):
    @exc.on_http_error(exc.GitlabDeleteError)
    # NOTE(jlvillal): Signature doesn't match DeleteMixin.delete() so ignore
    # type error
    def delete(  # type: ignore
    def delete(  # type: ignore[override]
        self, file_path: str, branch: str, commit_message: str, **kwargs: Any
    ) -> None:
        """Delete a file on the server.
+1 −1
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ class ProjectIssueLinkManager(ListMixin, CreateMixin, DeleteMixin, RESTManager):
    @exc.on_http_error(exc.GitlabCreateError)
    # NOTE(jlvillal): Signature doesn't match CreateMixin.create() so ignore
    # type error
    def create(  # type: ignore
    def create(  # type: ignore[override]
        self, data: Dict[str, Any], **kwargs: Any
    ) -> Tuple[RESTObject, RESTObject]:
        """Create a new object.
+2 −2
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ class GroupLabelManager(
    # Update without ID.
    # NOTE(jlvillal): Signature doesn't match UpdateMixin.update() so ignore
    # type error
    def update(  # type: ignore
    def update(  # type: ignore[override]
        self,
        name: Optional[str],
        new_data: Optional[Dict[str, Any]] = None,
@@ -132,7 +132,7 @@ class ProjectLabelManager(
    # Update without ID.
    # NOTE(jlvillal): Signature doesn't match UpdateMixin.update() so ignore
    # type error
    def update(  # type: ignore
    def update(  # type: ignore[override]
        self,
        name: Optional[str],
        new_data: Optional[Dict[str, Any]] = None,