-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3824 +/- ##
=======================================
Coverage 98.41% 98.41%
=======================================
Files 332 332
Lines 15472 15472
Branches 1701 1701
=======================================
Hits 15226 15226
Misses 113 113
Partials 133 133 ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3824 |
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 |
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.