The new option is called SpaceBeforeAndAfterArrows
True:
(pointer instance) -> (member)
False:
(pointer instance)->(member)
Paths
| Differential D71659
[clang-format] Added new option to allow setting spaces before and after the operator AbandonedPublic Authored by owenpan on Dec 18 2019, 6:08 AM.
Details Summary The new option is called SpaceBeforeAndAfterArrows True: False:
Diff Detail
Event TimelineLuis retitled this revision from Adde new option to allow setting spaces before and after the operator to Added new option to allow setting spaces before and after the operator.Dec 18 2019, 6:09 AM lebedev.ri retitled this revision from Added new option to allow setting spaces before and after the operator to [clang-format] Added new option to allow setting spaces before and after the operator.Dec 18 2019, 6:10 AM Comment Actions This feature is missing unit tests. Also, what is the reason for all the comment changes? I don't think the changed comment lines originally exceeded 80 characters. This revision now requires changes to proceed.Dec 18 2019, 6:16 AM Comment Actions
Yup, I will add the unit-test when I have time, regarding the comments, it's really weird because I'm using clang-format to format the file on save, I'll double check and try to revert those comment changes! Comment Actions Is there a reason why this option adds space before and after the tok::arrow token but not the tok::arrowstar token? That seems inconsistent to me. MyDeveloperDay added inline comments.
Comment Actions NOTE: Clang-Format Team Automated Review Comment
Your review contains a change to clang/include/clang/Format/Format.h but does not contain an update to ClangFormatStyleOptions.rst ClangFormatStyleOptions.rst is generated via clang/docs/tools/dump_format_style.py, please run this to regenerate the .rst You can validate that the rst is valid by running. ./docs/tools/dump_format_style.py mkdir -p html /usr/bin/sphinx-build -n ./docs ./html Comment Actions NOTE: Clang-Format Team Automated Review Comment
It looks like your clang-format review does not contain any unit tests, please try to ensure all code changes have a unit test (unless this is an NFC or refactoring, adding documentation etc..) Add your unit tests in clang/unittests/Format and you can build with ninja FormatTests. We recommend using the verifyFormat(xxx) format of unit tests rather than EXPECT_EQ as this will ensure you change is tolerant to random whitespace changes (see FormatTest.cpp as an example) For situations where your change is altering the TokenAnnotator.cpp which can happen if you are trying to improve the annotation phase to ensure we are correctly identifying the type of a token, please add a token annotator test in TokenAnnotatorTest.cpp
Revision Contents
Diff 234525 clang/include/clang/Format/Format.h
clang/lib/Format/Format.cpp
clang/lib/Format/TokenAnnotator.cpp
|
these are all unrelated changes please remove them from patch