watchforstock / evohome-client

Python client to access the Evohome web service
Apache License 2.0
88 stars 52 forks source link

Could we use black for formatting? #108

Open zxdavb opened 4 years ago

zxdavb commented 4 years ago

@watchforstock After HA switched to black, I have been using it in all my code.

It is life-changing, and I would like to use it on evohome-async, but would be reluctant to, as it would make code compares with evohome-client harder. On the other hand, if we were both black, then it would make comparing the two repos easier!

There is nothing to do, you just black ., and that is it!

As it is just a formatter, it shouldn't break anything...

Are you up for that?

(PS: what's your appetite for making all datetime objects in the code TZ aware)?

watchforstock commented 4 years ago

Hi @zxdavb ,

Not a tool I've come across, but sounds like a good idea (I've been using Go for a while which has this sort of tool built in). Are you in the position to put a PR in? It would presumably also be worthwhile including it in the circleci config to enforce it during builds?

Happy to merge a PR. Equally true of the datetimes - presumably it makes sense to do one at a time

Thanks

Andrew

zxdavb commented 4 years ago

I could do the reformatting, and go through it for hiccups, so will submit a PR for that.

I know you can do a pre-commit git hook to blacken a commit, before it is pushed... The technique looks pretty straight-forward, so will have a go at it. I think we can also drop pylint, in favour of only black/flake8 (and could take out all those hints).

I also don't how you do your mocking/testing, or any of that CricleCI workflow, really... Can I leave that up to you?

watchforstock commented 4 years ago

Thanks @zxdavb - I've merged that in together with initial tweaks to circleci to remove pylint and insert black.

zxdavb commented 4 years ago

You made that CircleCI stuff look too easy!