[libcxx-commits] [PATCH] D79343: [libc++][test] Adjust move_iterator tests to allow C++20
Duncan P. N. Exon Smith via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 6 15:19:57 PDT 2020
dexonsmith added a comment.
In D79343#2023658 <https://reviews.llvm.org/D79343#2023658>, @CaseyCarter wrote:
> I'm not going to reformat *only* my additions per the clang-format instructions - that would be silly - and I suspect that folks would clang-format all of the tests if they actually wanted them formatted, so I won't format the entire file, either.
I'm not sure how the `libcxx/` maintainers feel, but clang-formatting just the changes is the operating procedure in `llvm/` and `clang/`. Here's a script that makes it easy:
https://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting
I believe there's also a `git-clang-format` script checked in that you can leverage by adding it to your `PATH`.
The rules change regularly in subtle ways, usually because of fixes/regressions in `clang-format`, sometimes due to changes in policy. We don't do a mass reformat of the entire codebase on every commit though, instead we just update the lines that are being changed, edging things "closer". Maybe it would be better to do a mass reformat on policy changes but we haven't done that historically.
If a file is drastically out-of-whack, it's an option to reformat it in a separate format-only commit before making a change (never the same commit as a change because that makes it hard to see what changed).
Not trying to impose rules on libc++, just providing some context; I suspect these new linters are broadly following the procedure from LLVM and Clang.
================
Comment at: libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/types.pass.cpp:33
struct DummyIt {
- typedef std::forward_iterator_tag iterator_category;
- typedef ValueType value_type;
- typedef std::ptrdiff_t difference_type;
- typedef ValueType* pointer;
- typedef Reference reference;
+ typedef std::forward_iterator_tag iterator_category;
+ typedef ValueType value_type;
----------------
You seem to be changing from 2-space indent (the usual practice for LLVM) to 4-space indent here. I don't know if that's intentional, but if it's the right thing to do please do so in a separate commit to avoid adding noise to this patch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79343/new/
https://reviews.llvm.org/D79343
More information about the libcxx-commits
mailing list