This is the first commit in a series that will reformat
all the python files in the LLVM repository.
Reformatting is done with black.
See more information here:
https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style
Paths
| Differential D150545
[NFC][Py Reformat] Reformat python files in llvm ClosedPublic Authored by thieta on May 15 2023, 2:05 AM.
Details Summary This is the first commit in a series that will reformat Reformatting is done with black. See more information here: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style
Diff Detail
Event TimelineComment Actions LGTM. I would include something in the commit to make things easier for downstream users. If there are conflicts, they're probably better off keeping their version (git checkout --ours) and rerunning the same black command. I would also make sure to specify which version of black to use (23) as the output changes between versions and some distros might have older versions (when using their package manager instead of pip). This revision is now accepted and ready to land.May 15 2023, 10:58 AM Comment Actions Having a tool-enforces style will make reviewing contributions to the python scripts much easier since we don't have to worry about coding style. I wonder if it would make sense to also add a pre-commit (https://pre-commit.com/) config file to make it easy to automate? Comment Actions I picked a few random files and saw no issues from my point of view in them. LGTM.
This sounds like a good plan to me. This revision was landed with ongoing or failed builds.May 17 2023, 1:49 AM Closed by commit rGb71edfaa4ec3: [NFC][Py Reformat] Reformat python files in llvm (authored by thieta). · Explain Why This revision was automatically updated to reflect the committed changes. Comment Actions There are many lit.local.cfg files in the tree, I suppose some of them need to be reformatted too. Comment Actions Ah, I forgot to update the summary in this diff so the final commit message doesn't contain my help info :( If anyone finds this diff and are having problems with the commit because rebase/merge issues here is what I wrote and the rest of the commits will contain: This is the first commit in a series that will reformat all the python files in the LLVM repository. Reformatting is done with `black`. If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run git checkout --ours <yourfile> and then reformat it with black. If you run into any problems, post to discourse about it and we will try to help. RFC Thread below: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Comment Actions
Thanks for spotting that. Will post another diff for that. Comment Actions
Already did that as soon as I landed it: https://github.com/llvm/llvm-project/commit/2e18e7bac9c8e11b55a8b4f6c2b63b22b668cc0b
Large DiffThis large diff affects 262 files. Files without inline comments have been collapsed. Expand All Files
Revision Contents
Diff 522087 llvm/utils/lit/lit/main.py
llvm/utils/lit/tests/Inputs/googletest-format-respect-gtest-sharding-env-vars/DummySubDir/OneTest.py |
It appears that the concatenated strings are not really concatenated. Note the " ".