python-trio / flake8-async

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

Add pyright as well as tests and infrastructure inspired by bugbear #3

Closed jakkdl closed 2 years ago

jakkdl commented 2 years ago

I didn't find a way to configure pyright in setup.py, opted to use a pyproject.toml instead of a pyrightconfig.json.

With pytest-xdist commented out passing -n auto errors out. Commented out the parameter, but probs cleaner to uncomment both lines or remove both.

Could opt to explicitly list files to avoid checking setup.py instead of adding the check for __version__ in it.

jakkdl commented 2 years ago

All failed checks are for stuff I didn't touch in this pull request, opening another one that works on flake8_trio.py and adds basic tests.

Zac-HD commented 2 years ago
jakkdl commented 2 years ago

kk, let's just do that here then. I haven't delved into understanding the testing setup that bugbear uses, so just doing basic tests for now.

jakkdl commented 2 years ago

Okay, cribbed bugbear's testing setup. Had to replace the namedtuple+partial solution to get it to pass pyright, though likely possible to get a cleaner solution. Dropped stdin support for the filename parameter that bugbear had, was way too much of a hassle to get that covered and I'm not sure how big the need for it is. I've never done fuzz tests before, but copy-pasted to my heart's content and they seem to do something. Added back xdist since fuzzers started taking time.

jakkdl commented 2 years ago

fixed all comments, code starting to look pretty :sparkle: