python-trio / flake8-async

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

add pre-commit config #88

Closed jakkdl closed 1 year ago

jakkdl commented 1 year ago

It bit me a bunch of times that I didn't run tox before pushing minor changes, and tox -e check takes 13s on my system, so I've gradually recreated all the functionality from it in pre-commit + some other checks. So at this point it might be worth removing tox -e check entirely and transitioning the CI to use pre-commit as well. If you approve of the idea I'll implement the necessary gh CI changes as well & clean up tox.ini.

(though it currently won't pass until #87 is merged)

TODO:

Zac-HD commented 1 year ago

Sounds good to me; mark ready-to-review when... you know... and I'll be happy to merge.

jakkdl commented 1 year ago

I added https://pre-commit.ci/ to my fork, and it now passes on my mirror PR over there: https://github.com/jakkdl/flake8-trio/pull/1

The largest issue was that pyright requires internet connectivity to run, which the pre-commit ci does not support

There's a couple options to get around that:

Various other considerations for this, or future PR's, or never:

But otherwise I think this should be good for merging

jakkdl commented 1 year ago

rebased on top of main

jakkdl commented 1 year ago

Renamed the check ci action to show that it's now solely for type-checking. I tried doing that previously but failed, but idk what I did different that time.