python-trio / flake8-async

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

Make 107&108 optional? #117

Closed jakkdl closed 1 year ago

jakkdl commented 1 year ago

Now that we have added optional checks, I was struck by the thought that maybe 107&108 should be made optional as well? I remember it being singled out when you'd previously discussed it with other Trio folks, and as far as I understand they're not really errors - and it's highly viable to write a codebase where you only take as assumption that calls to the trio library guarantees checkpoints - but not when calling your own async functions. When transitioning a codebase to use this plugin I also imagine that they're going to be among the noisiest checks, and you might only want to enable them after fixing all the other checks.

Zac-HD commented 1 year ago

Yeah, makes sense, let's do it.

My intuition says "No, missing checkpoints break cancellation" - but so do async generators, and we made that check optional too for good reason. Noisy alarms just get ignored, so let's take the pragmatic path and disable by default. (#70 will also improve this a bit)