Correctly pull twisted trunk when triggered overnight and ignore known type error#16115
Correctly pull twisted trunk when triggered overnight and ignore known type error#16115DMRobertson merged 6 commits intodevelopfrom
Conversation
clokep
left a comment
There was a problem hiding this comment.
Any way to test this? Seems reasonable...
| # type-ignore: This is an error in Twisted's annotations. See | ||
| # https://github.com/twisted/twisted/issues/11812 and /11813 . | ||
| factory = manhole_ssh.ConchFactory(portal.Portal(rlm, [checker])) # type: ignore[arg-type] |
There was a problem hiding this comment.
Urgh, the error is only introduced in twisted trunk, so adding this triggers an unused-ignore error on the current build.
Maybe I can use a cast instead.
There was a problem hiding this comment.
I opted just to tell mypy to relax the unused-ignore check for this file. (Simpler, and I'm pretty sure it can complain about a redundant cast sometimes.)
There was a problem hiding this comment.
Not a huge fan of adding an ignored file, can we do type: ignore[arg-type,<whatever the code is for an unneeded ignore>?
There was a problem hiding this comment.
Hmm, I'm not sure it has an error code:
synapse/util/manhole.py:103: error: Unused "type: ignore" comment
Maybe I can just use a naked # type[ignore]?
There was a problem hiding this comment.
No luck, I'm afraid. 🚢 ping it
One day I'm gonna write a linter for this, and write a workflow to run the linter on all workflows, including the workflow itself.
|
I can test this by temporarily forcing this branch to run the twisted-trunk job. It looks like the changes were successful. They point to new typechecking errors: https://github.com/matrix-org/synapse/actions/runs/5868230260/job/15910583758?pr=16115, which I would guess are mostly due to twisted/twisted#11770 |
Should we fix that here or merge this and do a follow-up? |
My vote is the latter: merge and follow-up. |
|
(Will let CI run, then revert |
|
CI against the main release of twisted seemed fine. |
This reverts commit da3f079.
See the discussion in #15097.