python-trio / flake8-async

Highly opinionated linter for Trio code
https://flake8-async.readthedocs.io
MIT License
17 stars 2 forks source link

ASYNC102 no longer raises warning for calls to `.aclose()` on objects #222

Closed jakkdl closed 3 months ago

jakkdl commented 3 months ago

See #156

I'm not sure if #156 also covers more general discussion on if/how to overhaul async102 and should remain open after this is merged.

Zac-HD commented 3 months ago

Very quick notes:

and then I think we're ready and it'll close the linked issue.

jakkdl commented 3 months ago

don't exempt asyncio-only code; this is a trio/anyio semantics thing

I interpreted this as "if running with --anyio and not importing anyio/trio, or only importing asyncio => don't mark as safe; but if running with --anyio and/or importing anyio/trio and importing asyncio => mark as safe", so if you have a mixed project it'll lean towards not reporting acloses. But I could make it more aggressive and warn if there's any risk that this part concerns asyncio-code (i.e. asyncio in self.library -> "running with --asyncio; or asyncio is imported")