[PATCH] D102730: [clang-format] Support custom If macros

2021-06-23 Thread Vitali Lovich via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGbe9a87fe9bc3: [clang-format] Add IfMacros option (authored by vlovich). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D102730: [clang-format] Support custom If macros

2021-06-22 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich updated this revision to Diff 353823. vlovich added a comment. Rebase onto main. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102730/new/ https://reviews.llvm.org/D102730 Files: clang/docs/ClangFormatStyleOptions.rst clang/docs/Releas

[PATCH] D102730: [clang-format] Support custom If macros

2021-06-18 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich updated this revision to Diff 353150. vlovich marked an inline comment as done. vlovich added a comment. Fix clang-format issue Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102730/new/ https://reviews.llvm.org/D102730 Files: clang/docs/

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-06-18 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added a comment. I think you can go ahead & commit it for me. I don't know when I'll get commit access. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102706/new/ https://reviews.llvm.org/D102706 ___ cfe-commits mailing list cfe-commi

[PATCH] D102730: [clang-format] Support custom If macros

2021-06-16 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich updated this revision to Diff 352573. vlovich added a comment. Review response I've updated coverage for AllowShortIfStatementsOnASingleLine and BreakBeforeBraces. SpacesInConditionalStatement is what the existing tests were covering so I don't think there's anything there to update. I lo

[PATCH] D102730: [clang-format] Support custom If macros

2021-06-16 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added a comment. Just back from vacation so will try to polish this off today. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102730/new/ https://reviews.llvm.org/D102730 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-06-16 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added a comment. I don't know how to commit. Happy to do it if I have the permissions & appropriate instructions. Name: Vitali Lovich E-mail: vlov...@gmail.com CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102706/new/ https://reviews.llvm.org/D102706 _

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-05-27 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich marked an inline comment as done. vlovich added a comment. I think all review comments have been addressed. Please let me know if there's anything else blocking merge. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102706/new/ https://reviews.llvm.org/D102706 __

[PATCH] D102730: [clang-format] Support custom If macros

2021-05-27 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added inline comments. Comment at: clang/include/clang/Format/Format.h:2983 /// \endcode -SBPO_ControlStatementsExceptForEachMacros, +SBPO_ControlStatementsExceptControlMacros, /// Put a space before opening parentheses only if the parentheses are not --

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-05-21 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich updated this revision to Diff 347152. vlovich added a comment. Regen documentation & clang-format test cases. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102706/new/ https://reviews.llvm.org/D102706 Files: clang/docs/ClangFormatStyleOptions.rst clang/docs/ReleaseNotes.rst

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-05-21 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added a comment. In D102706#2774010 , @MyDeveloperDay wrote: > Is ```Signature``` effectively as is? Yes. I noted that it's the default behavior. Please let me know if I can clarify the documentation wording somehow (or if you have preferred wo

[PATCH] D102730: [clang-format] Support custom If macros

2021-05-21 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added inline comments. Comment at: clang/docs/ReleaseNotes.rst:252 +- Option ``IfMacros`` has been added. This lets you define macros that get + formatted like conditionals much like ``ForEachMacros`` get stiled like + foreach loops. MyDeveloperDay wrot

[PATCH] D102730: [clang-format] Support custom If macros

2021-05-21 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich updated this revision to Diff 347150. vlovich marked 3 inline comments as done. vlovich added a comment. Review response. Updated the options I changed via the dump_format_style.py script but didn't ingest all the other changes it generated. Changed the SBPO option to have a more generic

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-05-21 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added a comment. In D102706#2774018 , @MyDeveloperDay wrote: > Could you clang-format the tests please so I can more easily read them. Sure. I was just taking my queue from the rest of the file which appeared to intentionally not clang-format t

[PATCH] D102730: [clang-format] Support custom If macros

2021-05-20 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich updated this revision to Diff 346870. vlovich added a comment. Fixed missing _ after the hyperlink to the KJ link in the Style options documentation. I'm assuming that's required formatting for hyperlinks by what renders the markdown. CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-05-20 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich updated this revision to Diff 346869. vlovich added a comment. Herald added a subscriber: mgrang. Review response - Add examples to documentation + links to KJ style guide. - Add better header doc - Add more test cases - Add release notes - Note current "problem" test with a TODO (corner

[PATCH] D102730: [clang-format] Support custom If macros

2021-05-20 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich updated this revision to Diff 346864. vlovich marked an inline comment as done. vlovich added a comment. Updated release notes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102730/new/ https://reviews.llvm.org/D102730 Files: clang/docs/ClangFormatStyleOptions.rst clang/doc

[PATCH] D102730: [clang-format] Support custom If macros

2021-05-20 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich marked an inline comment as done. vlovich added inline comments. Comment at: clang/include/clang/Format/Format.h:2098 + /// + /// For example: KJ_IF_MAYBE. + std::vector IfMacros; HazardyKnusperkeks wrote: > vlovich wrote: > > Should I put a hyperlink

[PATCH] D102730: [clang-format] Support custom If macros

2021-05-20 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich updated this revision to Diff 346863. vlovich added a comment. Review response: - Added additional tests. - Added `KJ_IF_MAYBE` to default `IfMacros`. - Added links to KJ documentation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102730/new/ https://reviews.llvm.org/D102730

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-05-20 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added a comment. > verifyFormat("test() {\n" > > " ([]() -> {\n" > "int b = 32;\n" > "return 3;\n" > " }).foo();\n" > "}", > Style); > > There you have parenthesis around the lambda, how about without? > Maybe just something like > > std::sort(v.begin(), v.end(),

[PATCH] D102730: [clang-format] Support custom If macros

2021-05-18 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added inline comments. Comment at: clang/include/clang/Format/Format.h:2098 + /// + /// For example: KJ_IF_MAYBE. + std::vector IfMacros; Should I put a hyperlink to https://github.com/capnproto/capnproto/blob/master/kjdoc/tour.md#maybes? Repository

[PATCH] D102730: [clang-format] Support custom If macros

2021-05-18 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich created this revision. vlovich added reviewers: curdeius, MyDeveloperDay, HazardyKnusperkeks. vlovich added a project: clang-format. vlovich requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Like with ForEachMacros, support user to pr

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-05-18 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added a comment. In D102706#2766680 , @HazardyKnusperkeks wrote: > Maybe a bit more test cases with smaller lambdas? Or without the outer > parenthesis? I'm not sure I understand this comment. Which test case are you referring to by "or withou

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-05-18 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich added a comment. I'm not 100% certain if the implementation is absolutely correct. For example, the `#define A` test case is broken (the closing brace is on the wrong line). Additionally, the `pop_back` feels weird but seems to fix all the other cases to make the closing brace aligned p

[PATCH] D102706: [clang-format] Add new LambdaBodyIndentation option

2021-05-18 Thread Vitali Lovich via Phabricator via cfe-commits
vlovich created this revision. vlovich added reviewers: MyDeveloperDay, curdeius. vlovich added a project: clang-format. vlovich requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Currently the lambda body indents relative to where the lambda