[FEATURE] Adds type validation GitHub action#96
Merged
rodrigo-pessoa-lrn merged 3 commits intoNov 6, 2024
Merged
Conversation
f7c3f2b to
a3938d1
Compare
Contributor
ferdia-sopermaccafraidh-lrn
left a comment
There was a problem hiding this comment.
👏 praise: couple of comments but looking good 👍
0beebf2 to
2012163
Compare
c70a7e3 to
adc8c10
Compare
e984de2 to
990e7bc
Compare
| self.secret = secret | ||
| self.request = request | ||
| if hasattr(request, 'copy'): | ||
| # TO DO: Fix improper handling when request is a string (bug relevead by proper typing). Issue: AIL-415 |
Contributor
There was a problem hiding this comment.
🤓 nitpick:
Suggested change
| # TO DO: Fix improper handling when request is a string (bug relevead by proper typing). Issue: AIL-415 | |
| # TODO: Fix improper handling when request is a string |
990e7bc to
66bec37
Compare
66bec37 to
1af8eca
Compare
ferdia-sopermaccafraidh-lrn
approved these changes
Nov 6, 2024
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.
Problem Statement
Since PR #81 is merged (relating to typing), a workflow (Github Action CI) should be added to ensure that typing is enforced, consistent and so that it is not out of sync over time.
PR Actions
Follow up work after PR #81.
What was done
--strictsetting).How was this change tested
mypy --strict learnosity_sdkto verify all type hints and issues.Notes:
learnosity_sdk/request/init.pywas failing the MyPy check. The main changes to the logic were handling the cases where the optional request parameter was not provided (i.e. wasNone). I chose to raise errors in the cases where request wasNone(but needed to a dictionary) to avoid introducing logic and potentially silent errors / bugs.