Open tomage opened 2 years ago
To add: I do want to put in some pre-push git hook to prevent the code from being de-blackified, but I've also found that it's good to do this a bit after blackifying the codebase, so as to not stir things up too much.
Once (if?) we do add such a hook (for example via the pre-commit.com mechanism), there might be some files that will have gone out-of-black format, but it's no big deal to blackify them along with adding the hook.
EDIT: This is really a tiny PR - should take about 5 mins to review I promise :)
Right.. This is a big one! But also, a small one.
It's big because it changes a lot of files, and it may introduce coding styles foreign to some developers.
It's small because functionally, the code is exactly the same. Black is written by one of the core contributors to python, and he did a clever thing with black: It compares the AST (abstract syntax tree) of the code before and after, and makes sure it's the same. This pretty much makes sure that the code functions the same. Hence, this patch is actually small.
**The only files that need any reviewing here are:
format
targetprint()
calls) and ran black on it, as all other.py
files.pyproject.toml
is nice. It can be used to configure other aspects of our python projects later on. Read more about it here: https://peps.python.org/pep-0621/ and here: https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/.All of the other files are
.py
files changed by black, and thus need no reviewing, unless if the reader is curious howblack
is formatting the files.