python-trio / flake8-async

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

21X and 22X, blocking sync calls in async function #94

Closed jakkdl closed 1 year ago

jakkdl commented 1 year ago

Checking off the first couple sync calls in #58

Flake8TrioVisitor.__subclasses__ didn't do it anymore once I started using multilevel inheritance, so solved it by creating a decorator for error classes that registers them. (type hinting the decorator function was fun :sweat_smile:)

Wasn't sure if the http calls and process invocation bullet points wanted different error messages for each, and the messages themselves are kinda rough, but went with this for a first pass.

TODO:

Don't bother merging both this and #91, merge one and I'll fix the conflicts in the other.

jakkdl commented 1 year ago

Not gonna bother composing beautiful error messages and readme texts until the split has been decided on.

jakkdl commented 1 year ago

addressed comments, rebased on top of main. This PR is turning out quite meaty indeed.

The documentation and error messages are still mediocre, feel free to suggest changes.