I'm about to submit a change which involves re-writing most of
cxa_guard_impl.h. Running clang-format on the whole file first seems like a
good idea.
Details
- Reviewers
zibi ldionne EricWF - Group Reviewers
Restricted Project - Commits
- rGf6ba6c397641: [NFC][libcxxabi] Run clang-format on libcxxabi/src/cxa_guard_impl.h
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'd normally frown upon this since we generally don't clang-format whole files at once, but since the changes are pretty small, it might be OK to do that. But we definitely want to clang-format it right though.
libcxxabi/src/cxa_guard_impl.h | ||
---|---|---|
44–47 | We definitely want to tweak our clang-format configuration such that nested #ifs are indented. It's really difficult to read otherwise (kind of like if we did not indent regular nested if (...) statements). | |
133 | The line length here is 80, but we use 120 in libc++ unless I'm mistaken. I think we should be using the same configuration for libc++ and libc++abi. |
I know we're supposed to make the whitespace/formatting changes "highly localized" to the area we're about to make changes to, but since I'm going to be making changes to %80 of the file anyways, leaving the nonconformant formatting in the remaining %20 felt rather silly. Was this the wrong decision? Is there ever a situation where running clang-format on a whole file like this is recommend?
LGTM, but just for anyone watching, don't consider this as setting precedent for clang-formating full files arbitrarily. We normally don't do this, but since the author is going to almost rewrite the file, this seems somewhat more reasonable.
Also, consider dropping [SystemZ][z/OS] from the commit message since it has nothing to do with those -- those tags are useful insofar as they are used only when a commit is really related to the tags, otherwise they lose their power.
We definitely want to tweak our clang-format configuration such that nested #ifs are indented. It's really difficult to read otherwise (kind of like if we did not indent regular nested if (...) statements).