-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
chore(mypy): enable truthy-bool
error code
#3824
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3824 +/- ##
==========================================
+ Coverage 98.42% 98.44% +0.01%
==========================================
Files 333 333
Lines 15348 15346 -2
Branches 1694 1693 -1
==========================================
Hits 15107 15107
+ Misses 111 110 -1
+ Partials 130 129 -1 ☔ View full report in Codecov by Sentry. |
Seems to be a missing test case? |
I am not quite sure, to be honest :) litestar/litestar/security/base.py Lines 90 to 95 in f7b258f
Where litestar/litestar/openapi/config.py Line 91 in f7b258f
Components can never be false (it does not have __bool__ or __len__ defined).
So, mypy raises an error for this case. We either have:
|
Isn't it the |
eb26f81
to
f9b187d
Compare
Quality Gate passedIssues Measures |
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3824 |
Docs: https://mypy.readthedocs.io/en/stable/error_code_list2.html#check-that-expression-is-not-implicitly-true-in-boolean-context-truthy-bool
I am using
# type: ignore[truthy-bool]
for.components
check, because I see that it is treated specially for some reason (likepragma: no cover
). Is this correct?I also removed configs that are part of the
--strict
flag from settings.