chore: add type-hints to gitlab/v4/objects/merge_requests.py#1673
Merged
Conversation
* Add type-hints to gitlab/v4/objects/merge_requests.py * Add return value to cancel_merge_when_pipeline_succeeds() function as GitLab docs show it returns a value. * Add return value to approve() function as GitLab docs show it returns a value. * Add 'get()' method so that type-checkers will understand that getting a project merge request is of type ProjectMergeRequest.
8a0f9de to
f9c0ad9
Compare
Codecov Report
@@ Coverage Diff @@
## main #1673 +/- ##
==========================================
- Coverage 91.99% 91.96% -0.04%
==========================================
Files 75 75
Lines 4337 4345 +8
==========================================
+ Hits 3990 3996 +6
- Misses 347 349 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
nejch
reviewed
Nov 7, 2021
Comment on lines
+459
to
+462
| def get( | ||
| self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| ) -> ProjectMergeRequest: | ||
| return cast(ProjectMergeRequest, super().get(id=id, lazy=lazy, **kwargs)) |
Member
There was a problem hiding this comment.
Maybe for a follow-up it'd be good to document this in the Development docs so we can point people to this in case they are adding new managers and get hit by mypy errors?
nejch
approved these changes
Nov 7, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
as GitLab docs show it returns a value.
returns a value.
getting a project merge request is of type ProjectMergeRequest.