python-trio / flake8-async

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

add TRIO212: sync call on httpx.Client, move type-tracking logic #118

Closed jakkdl closed 1 year ago

jakkdl commented 1 year ago

Ticks another box in #58

All the code ... just worked .. on the first try?? I got so paranoid about the testing infrastructure being broken, but nope - turns out I was just writing correct code over and over.

Not the prettiest class structure since the type-tracking class can't be reused for classes that don't want to inherit from Visitor200, but I'll fix that if/when I want to do that. Or does nurseries want this functionality? Or anything else?

The diff looks relatively large because a big chunk of code is moved without being modified, but this should otherwise be pretty straightforward to review.

jakkdl commented 1 year ago

CI found a typo in eval_files/trio232.py, that I think got missed by tests not being rerun on the TRIO232 PR after codespell was added to pre-commit (and it wasn't merged when codespell was run manually in #113). So that's also randomly fixed

jakkdl commented 1 year ago

Also added urllib3 pools. Didn't add explicit blocking methods on those since they're so many, but presumably there might be some. (Though probably easier to add a whitelist of allowed method calls). Not the prettiest code, but should be fine enough.

Zac-HD commented 1 year ago

Nice! I'll aim to release in the next few days.