-
Notifications
You must be signed in to change notification settings - Fork 132
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
Fix mypy discovery & all type errors across source #507
Conversation
@@ -1,19 +1,28 @@ | |||
[mypy] | |||
strict = True | |||
disallow_untyped_calls = False | |||
exclude = ["tests"] |
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.
turns out, this is a regex field and was making mypy avoid running on most source files.
mypy was reporting to be running on 3 source files; after these adjustments, it is reporting to run on 70 source files, and pointed out all the additional issues fixed in this PR.
if meta is None: | ||
meta = {} | ||
data = {"status": "success", "data": content, "meta": meta} | ||
return json.ORJSONResponse(data, status_code, headers) | ||
# XXX:HACK to make typing work | ||
return cast(Success[T], json.ORJSONResponse(data, status_code, headers)) |
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.
@tsunyoku rate the based hacks
@@ -22,7 +22,7 @@ | |||
import app.settings | |||
import app.state | |||
import app.utils | |||
from app.api import api_router | |||
from app.api import api_router # type: ignore[attr-defined] |
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 think this is a result of a circular import, but i'm not 100% sure
if not ( | ||
ctx.player in match.refs | ||
or ctx.player.priv & Privileges.TOURNEY_MANAGER | ||
or f is mp_help.__wrapped__ # type: ignore[attr-defined] |
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.
pretty funny find
Describe your changes
Related Issues / Projects
Checklist
make lint
)