internetarchive
internetarchive copied to clipboard
Enable black formatting in pre-commit
Add https://github.com/pre-commit/pre-commit-hooks#double-quote-string-fixer because this repo tends to favor single-quotes instead of black-standard double-quotes.
Remove --diff
option which prevents black
from re-formatting our Python files.
Moveisort
configuration into setup.cfg
.
Move black
configuration out of setup.cfg
because black
only supports config via pyproject.toml
.
pre-commit autoupdate
pre-commit run --all-files
It is awesome that we reached this state. I was working on this some months ago when Black reached stable status. Together with sorted imports and so on, minus the type declarations which we have now, but dropped it because it was just such a huge amount of work and getting it all to work together with Poetry was a pain.
I also did not want to do it via pre-commit hooks at the time, but you found a good way to do it with pre-commit hooks.
This should remove virtually all formatting related corrections on new pull requests.
I have never gotten Poetry to sing for me.