Closed CoolCat467 closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
70c8b76
) 99.44% compared to head (9d0008f
) 99.64%.
At the moment the tests will fail until #2946 gets merged, and even then there will be a failure detailed in https://github.com/astral-sh/ruff/issues/9855 that is a bug.
Disclaimer: I'm the one that wrote 99% of the code in flake8-trio.
Ruffs implementation of flake8-trio is only a small set (6 out of ~30) of the full rules: https://github.com/Zac-HD/flake8-trio Although a few of them are handled under other rules.
The plugin is intended for users of trio or anyio*, so some rules might not make sense in trio itself, but can ofc then just disable those.
It is also possible to run flake8-trio as a standalone*, so we don't have to bring back flake8. (because we wanted to implement autofix with libcst, which isn't possible when running with flake8). But there might be reasons to run it through flake8, I don't fully remember.
* yes, both parts of the flake8-trio name are incorrect... https://github.com/Zac-HD/flake8-trio/issues/124#issuecomment-1454034177
I just want to mention that ruff's TRIO rules are significantly behind flake8-trio
, and produce some false positives as a result. See astral-sh/ruff#9934 and astral-sh/ruff#9935.
Given that ruff's version has a few issues and other points mentioned, I don't think this particular rule is fit for Trio at the moment.
Originally posted by @TeamSpen210 in https://github.com/python-trio/trio/issues/2946#issuecomment-1928600531
This pull request enables the
flake8-trio
ruff rule (but in ruff's system it's marked asTRIO
).