Closed carldlaird closed 1 year ago
I have one more big PR coming that it would be nice to wait a bit and not conflict. I am still working to get a couple tests passing and then can put up a WIP PR so that you can (hopefully) avoid those files while you start applying black.
Should we do black in chunks to keep the PR process simpler, or do it in one big chunk so that we only need to have a small number of revs in the .git-blame-ignore-revs
file (see here)
I intend to do the black
application in chunks so as to not make it a reviewing nightmare.
Also, for posterity, I intend to run this command: black -S <path>
<- The -S
skips string normalization.
Double check these files to make sure the line numbers are correct after applying black
The problematic line was replaced in #2754
Will black also affect contrib directories?
@bernalde yes but we're applying it in phases to reduce merge conflicts as much as possible with currently open PRs (including the MindtPy rewrite). If you have a specific module in contrib that you want us to wait to apply it to let us know.
None in particular right now. I would say that for those of us writing code, it might be better if we are told how to implement the formatting correctly. Something along the lines of https://jump.dev/JuMP.jl/stable/developers/style/#Style-guide
Yep, we will definitely document formatting expectations after finishing this first pass. I expect we'll also need some automated infrastructure to make sure new PRs are complying but we haven't discussed what this will look like yet.
I have a plan to implement something similar to what IDAES does in that it has a linting check at the beginning of the job pipeline - if the linting is wrong, none of the other jobs will run.
Adding another comment for posterity:
black
will combine previously wrapped lines of string and not get rid of the intermediary quotation marks. These need to be removed so they aren't quite as messy.For closure:
black -S -C <path> --exclude examples/pyomobook/python-ch/BadIndent.py
(we ignore that one file as it is intentionally wrong)black 23.3.0
" "
, ' '
, or r" "
in the middle of a string. These were fixed manually.
IDAES recently implemented the usage of
black
to enforce PEP8 compliance; in interest of compatibility, I would like to implement the same. I intend to runblack
on the entire codebase after the following are merged:2689
2654
2648
2294