pyGSTi
pyGSTi copied to clipboard
Code formatting in pyGSTi
This feature request is a nomination to run all the code in pyGSTi through black, an extremely popular auto-formatter for python. From their home page:
Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting. You will save time and mental energy for more important matters.
The benefits of doing this are substantial:
- Code run through Black has many of the requirements of Pep 8 enforced automatically.
- Black is entirely automatic: simply run
black myfile.py
or configure your editor to do it automatically. - PRs will no longer have minor stylistic differences between them.
- Eventually, it can be automatically run via CI.
The cost is really just having someone loop over all the files and run Black. Also, if anyone is very particular about the minutia of their code (e.g., encoding elaborate ASCII art in their code) they will not like Black. Black does not impact any code function.
(I'm willing to do the legwork on this one if there is consensus that it's OK)