[Openmp-commits] [PATCH] D38837: Add explicit values to .clang-format

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Oct 12 13:52:46 PDT 2017


jlpeyton added a comment.

That is peculiar that the DisableFormat attribute is true for our defaults in comments.  I don't know why that is.

Anyways, I thought one could use `git clang-format` to only format the OMPT changes, or any current change.  You do not have to format the entire file or maybe I have this wrong?

What I would try (if using git) is

1. Remove these changes to .clang-format
2. Take the large OMPT patch, create a separate branch based on current master
3. Apply the patch, and commit only the src/* files there.  It looks like the test files shouldn't be run through clang-format because they contain large // CHECK: lines which should not be broken up.  You can pick and choose of course.
4. Run:

$ git clang-format HEAD~1
This should reformat only the changes different between HEAD~1..HEAD (the large OMPT patch) and leave the reformatting changes in unstaged files so they are easy to get rid of if something goes wrong.

5. Commit the reformatting changes
6. Mash those new formatting changes in with the current OMPT patch
7. Submit it again to Phabricator :-D

The OMPT patch currently has lines that go over 80 characters (e.g., kmp_tasking.cpp) suggesting that the current OMPT patch has not been run through any real clang-format filter.


https://reviews.llvm.org/D38837





More information about the Openmp-commits mailing list