[PATCH] D88227: [clang-format] Add a SpaceBeforePointerQualifiers style option

2020-09-24 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw added a comment. Perhaps PointerAlignment should be an enum of Left, Middle, Right? We maintain an internal patch that adds "ReferenceAlignment" as separate from PointerAlignment. So one could have: PointerAlignment: Middle ReferenceAlignment: Left Repository: rG LLVM Github M

[PATCH] D42034: [clang-format] In tests, expected code should be format-stable

2019-03-21 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw added inline comments. Comment at: cfe/trunk/unittests/Format/FormatTest.cpp:78 EXPECT_EQ(Expected.str(), format(Code, Style)); if (Style.Language == FormatStyle::LK_Cpp) { // Objective-C++ is a superset of C++, so everything checked for C++ --

[PATCH] D55170: [clang-format]: Add NonEmptyParentheses spacing option

2019-03-20 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw added a comment. In D55170#1436087 , @klimek wrote: > Oh wow, wasn't aware how popular this is. Sigh. I'd like us to push them to > change their style guide, but I guess that's not going to fly. IDK. If the criteria is "public coding standard

[PATCH] D42034: [clang-format] In tests, expected code should be format-stable

2018-04-04 Thread Mark Zeren via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL329231: [clang-format] In tests, expected code should be format-stable (authored by mzeren-vmw, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D42

[PATCH] D42034: [clang-format] In tests, expected code should be format-stable

2018-04-03 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw added a comment. In https://reviews.llvm.org/D42034#1051965, @mzeren-vmw wrote: > Update other verifyFormat implementations. Ping? Repository: rC Clang https://reviews.llvm.org/D42034 ___ cfe-commits mailing list cfe-commits@lists.l

[PATCH] D42034: [clang-format] In tests, expected code should be format-stable

2018-03-29 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw updated this revision to Diff 140276. mzeren-vmw added a comment. Update other verifyFormat implementations. Repository: rC Clang https://reviews.llvm.org/D42034 Files: unittests/Format/FormatTest.cpp unittests/Format/FormatTestComments.cpp unittests/Format/FormatTestJS.cpp

[PATCH] D42035: [clang-format] Fixup #include guard indents after parseFile()

2018-02-05 Thread Mark Zeren via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL324238: [clang-format] Fixup #include guard indents after parseFile() (authored by mzeren-vmw, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/

[PATCH] D42034: [clang-format] In tests, expected code should be format-stable

2018-02-01 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw updated this revision to Diff 132395. mzeren-vmw added a comment. - Reviewers: drop euhlmann, add djasper - Rebase - Ping Repository: rC Clang https://reviews.llvm.org/D42034 Files: unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp

[PATCH] D42035: [clang-format] Fixup #include guard indents after parseFile()

2018-02-01 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw updated this revision to Diff 132394. mzeren-vmw added a comment. - Add comments to IncludeGuardState. - Fix re-initialization of IncludeGuard in UnwrappedLineParser::reset. - Remove unnecessary block after if. - Rebase Repository: rC Clang https://reviews.llvm.org/D42035 Files:

[PATCH] D42035: [clang-format] Fixup #include guard indents after parseFile()

2018-02-01 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:244 PPBranchLevel = -1; - IfNdefCondition = nullptr; - FoundIncludeGuardStart = false; - IncludeGuardRejected = false; + IncludeGuard = IG_Inited; + IncludeGuardToken = nullptr; -

[PATCH] D42035: [clang-format] Fixup #include guard indents after parseFile()

2018-01-31 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw updated this revision to Diff 132320. mzeren-vmw added a comment. rebase, ping. Repository: rC Clang https://reviews.llvm.org/D42035 Files: lib/Format/UnwrappedLineParser.cpp lib/Format/UnwrappedLineParser.h unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest

[PATCH] D42408: [clang-format] Align preprocessor comments with #

2018-01-31 Thread Mark Zeren via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL323904: [clang-format] Align preprocessor comments with # (authored by mzeren-vmw, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D42408?vs=13

[PATCH] D42408: [clang-format] Align preprocessor comments with #

2018-01-22 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw created this revision. mzeren-vmw added reviewers: krasimir, klimek, djasper. r312125, which introduced preprocessor indentation, shipped with a known issue where "indentation of comments immediately before indented preprocessor lines is toggled on each run". For example these two forms

[PATCH] D42036: [clang-format] Keep comments aligned to macros

2018-01-22 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw added a comment. In https://reviews.llvm.org/D42036#984401, @djasper wrote: > To me, aligning with the define seems fundamentally wrong. we definitely have code that does that internally. It can also be seen in the wild e.g.: https://github.com/boostorg/config/blob/develop/include/b

[PATCH] D42036: [clang-format] Keep comments aligned to macros

2018-01-18 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw marked 2 inline comments as done. mzeren-vmw added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:1756 + if (Alignment == CA_Preprocessor) +(*I)->LevelOffset = 1; } else { krasimir wrote: > This feels a bit awkward: we're

[PATCH] D42036: [clang-format] Keep comments aligned to macros

2018-01-18 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw updated this revision to Diff 130487. mzeren-vmw added a comment. Documented CommentAlignment enumerators. Documenting them suggested better enumerator names. Added tests for multi-line comments, block comments and trailing comments. Repository: rC Clang https://reviews.llvm.org/D

[PATCH] D42036: [clang-format] Keep comments aligned to macros

2018-01-16 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw added a comment. In https://reviews.llvm.org/D42036#976827, @klimek wrote: > Just from a formatting point of view, why not: > > //. Comment > #.define X (assuming the '.'s are unintentional) There is some logic in placing `//` in column 0, since we place `#` in column 0. H

[PATCH] D42036: [clang-format] Keep comments aligned to macros

2018-01-14 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw created this revision. mzeren-vmw added reviewers: euhlmann, krasimir, klimek. Herald added a subscriber: cfe-commits. r312125, which introduced preprocessor indentation, shipped with a known issue where "indentation of comments immediately before indented preprocessor lines is toggled

[PATCH] D42035: [clang-format] Fixup #include guard indents after parseFile()

2018-01-14 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw created this revision. mzeren-vmw added reviewers: euhlmann, krasimir, klimek. Herald added a subscriber: cfe-commits. When a preprocessor indent closes after the last line of normal code we do not correctly fixup include guard indents. For example: #ifndef HEADER_H #define HEADER_

[PATCH] D42034: [clang-format] In tests, expected code should be format-stable

2018-01-14 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw created this revision. mzeren-vmw added reviewers: klimek, krasimir, euhlmann. Herald added a subscriber: cfe-commits. Extend the verifyFormat helper function to check that the expected text is "stable". This provides some protection against bugs where formatting results are ocilating b

[PATCH] D35955: clang-format: Add preprocessor directive indentation

2017-08-23 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw added inline comments. Comment at: lib/Format/ContinuationIndenter.cpp:383 + Current.Previous->is(tok::hash) && State.FirstIndent > 0) { +// subtract 1 so indent lines up with non-preprocessor code +Spaces += State.FirstIndent; djasper wro

[PATCH] D35955: clang-format: Add preprocessor directive indentation

2017-08-15 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw added inline comments. Comment at: unittests/Format/FormatTest.cpp:2281 TEST_F(FormatTest, LayoutMacroDefinitionsStatementsSpanningBlocks) { verifyFormat("#define A \\\n" mzeren-vmw wrote: > Experimenting with the patch locally I found that comme

[PATCH] D35955: clang-format: Add preprocessor directive indentation

2017-08-11 Thread Mark Zeren via Phabricator via cfe-commits
mzeren-vmw added a comment. Daniel's right. We need need substantially more tests! Comment at: docs/ClangFormatStyleOptions.rst:1199 + * ``PPDIS_AfterHash`` (in configuration: ``AfterHash``) +Indents directives after the hash, counting the hash as a column. + -