-
Notifications
You must be signed in to change notification settings - Fork 72
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
misc: add pyright ignores for places where it's not going to be happy #3263
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3263 +/- ##
=======================================
Coverage 89.94% 89.94%
=======================================
Files 443 443
Lines 55559 55557 -2
Branches 8673 8673
=======================================
Hits 49973 49973
+ Misses 4158 4156 -2
Partials 1428 1428 ☔ View full report in Codecov by Sentry. |
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.
Nice! I just had one comment in one place
|
||
assert not isa(1, Literal["1"]) | ||
assert not isa("1", Literal[1]) | ||
assert isa("string", Literal["string"]) # pyright: ignore[reportArgumentType] |
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.
Is it the error that Literal
is a TypeExpr
and not a type
?
xdsl/tools/tblgen_to_py.py
Outdated
@@ -474,7 +474,7 @@ def generate_op(self, tblgen_op: TblgenOp, dialect_name: str): | |||
fields[name] = "var_region_def()" | |||
case (True, True): | |||
fields[name] = 'var_region_def("single_block")' | |||
case _: | |||
case _: # pyright: ignore[reportUnnecessaryComparison] |
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.
Wait, should we just remove the default case then? We had this just because pyright wasn't happy, but now it is
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.
Yep I'll remove the default case with the new pyright, the old one still wants it. I guess I could remove it now and ignore the pyright error on the match case directly, I'll do that quickly.
Pyright used to be happy to accept type expressions as types, but is happy no longer. This adds the required pyright ignores to work around this restriction.
Pylance errors: 94 -> 81