-
-
Notifications
You must be signed in to change notification settings - Fork 302
refactor(cargo_provider): cleanup and get rid of potential type errors #1599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4-10-1
Are you sure you want to change the base?
refactor(cargo_provider): cleanup and get rid of potential type errors #1599
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v4-10-1 #1599 +/- ##
==========================================
Coverage ? 98.33%
==========================================
Files ? 58
Lines ? 2701
Branches ? 0
==========================================
Hits ? 2656
Misses ? 45
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
de6dcff to
36698e7
Compare
efb485a to
1c1c09d
Compare
| return document["workspace"]["package"]["version"] # type: ignore[index,return-value] | ||
| def get(self, document: TOMLDocument) -> str: | ||
| out = _try_get_workspace(document)["package"]["version"] | ||
| assert isinstance(out, str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised our linting rule does not block this. I'll create another PR for that. But no, I don't think we should allow assert in production code. If we want to make mypy happy
if TYPE_CHCKING:
assert ...should be used insetad
Description
Checklist
Code Changes
poetry alllocally to ensure this change passes linter check and testsDocumentation Changes
poetry doclocally to ensure the documentation pages renders correctlyExpected Behavior
Steps to Test This Pull Request
Additional Context