[clang] 2c3b12b - [clang-format][NFCish] Obey debug settings

2023-08-02 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2023-08-02T11:50:14+02:00 New Revision: 2c3b12b5418fa4aa3aeb3f2154ae7bedbd1feac8 URL: https://github.com/llvm/llvm-project/commit/2c3b12b5418fa4aa3aeb3f2154ae7bedbd1feac8 DIFF: https://github.com/llvm/llvm-project/commit/2c3b12b5418fa4aa3aeb3f2154ae7bedbd1feac8.diff

[clang] f274ffc - [clang-format][NFC] Resort IO Mapping

2023-08-02 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2023-08-02T11:50:14+02:00 New Revision: f274ffc3034192179de14edb3be1ed85615aac42 URL: https://github.com/llvm/llvm-project/commit/f274ffc3034192179de14edb3be1ed85615aac42 DIFF: https://github.com/llvm/llvm-project/commit/f274ffc3034192179de14edb3be1ed85615aac42.diff

[clang] [clang-format] Correctly annotate designated initializer with PP if (PR #65409)

2023-09-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/65409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] BreakBeforeNoexceptSpecifier option added (PR #65808)

2023-09-08 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks review_requested https://github.com/llvm/llvm-project/pull/65808 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] BreakBeforeNoexceptSpecifier option added (PR #65808)

2023-09-08 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks review_requested https://github.com/llvm/llvm-project/pull/65808 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] BreakBeforeNoexceptSpecifier option added (PR #65808)

2023-09-08 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks created https://github.com/llvm/llvm-project/pull/65808: It really bugs me that it breaks to ``` c++ ...) noexcept( noexcept(condition)... ``` This is a fix for people like me. From d0415b4436a11e649fbeae53b8060f70bae03254 Mon Sep 17 00:00:00 2001 From

[clang] [clang-format] BreakBeforeNoexceptSpecifier option added (PR #65808)

2023-09-09 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks resolved https://github.com/llvm/llvm-project/pull/65808 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] BreakBeforeNoexceptSpecifier option added (PR #65808)

2023-09-09 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks updated https://github.com/llvm/llvm-project/pull/65808: From d0415b4436a11e649fbeae53b8060f70bae03254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Fri, 8 Sep 2023 13:07:09 +0200 Subject: [PATCH 1/2] [clang-format] BreakBefore

[clang] [clang-format] BreakBeforeNoexceptSpecifier option added (PR #65808)

2023-09-09 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks updated https://github.com/llvm/llvm-project/pull/65808: From 3d3b20f66212f86bd46853432f1be31e5977df83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Fri, 8 Sep 2023 13:07:09 +0200 Subject: [PATCH] [clang-format] BreakBeforeNoex

[clang] [clang-format] BreakBeforeNoexceptSpecifier option added (PR #65808)

2023-09-09 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks closed https://github.com/llvm/llvm-project/pull/65808 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Properly indent lines inside Verilog case structure (PR #65861)

2023-09-10 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/65861 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Björn Schäpers via cfe-commits
@@ -1016,6 +1016,14 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { ASSERT_EQ(Tokens.size(), 22u) << Tokens; EXPECT_TOKEN(Tokens[4], tok::kw_requires, TT_RequiresClause); EXPECT_TOKEN(Tokens[10], tok::ampamp, TT_PointerOrReference); + + Tokens = a

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks requested changes to this pull request. https://github.com/llvm/llvm-project/pull/65908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Björn Schäpers via cfe-commits
@@ -1016,6 +1016,14 @@ TEST_F(TokenAnnotatorTest, UnderstandsRequiresClausesAndConcepts) { ASSERT_EQ(Tokens.size(), 22u) << Tokens; EXPECT_TOKEN(Tokens[4], tok::kw_requires, TT_RequiresClause); EXPECT_TOKEN(Tokens[10], tok::ampamp, TT_PointerOrReference); + + Tokens = a

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/65908 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Björn Schäpers via cfe-commits
@@ -3369,9 +3369,13 @@ bool clang::format::UnwrappedLineParser::parseRequires() { case tok::kw_volatile: case tok::kw_const: case tok::comma: - FormatTok = Tokens->setPosition(StoredPosition); - parseRequiresExpression(RequiresToken); - return false;

[clang] [clang-format] Fix requires misannotation with comma (PR #65908)

2023-09-10 Thread Björn Schäpers via cfe-commits
@@ -3369,9 +3369,13 @@ bool clang::format::UnwrappedLineParser::parseRequires() { case tok::kw_volatile: case tok::kw_const: case tok::comma: - FormatTok = Tokens->setPosition(StoredPosition); - parseRequiresExpression(RequiresToken); - return false;

[clang] 1116ed2 - [clang-format] Correctly count a tab's width in a comment

2023-07-12 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2023-07-12T12:23:19+02:00 New Revision: 1116ed2beb1cd62a4b450efead481009af19df62 URL: https://github.com/llvm/llvm-project/commit/1116ed2beb1cd62a4b450efead481009af19df62 DIFF: https://github.com/llvm/llvm-project/commit/1116ed2beb1cd62a4b450efead481009af19df62.diff

[clang] ce7356f - [clang-format] Don't eat two semicolons after namespace

2023-07-12 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2023-07-12T12:23:20+02:00 New Revision: ce7356f08194083c205b92e77d1a4cd515a2a5b8 URL: https://github.com/llvm/llvm-project/commit/ce7356f08194083c205b92e77d1a4cd515a2a5b8 DIFF: https://github.com/llvm/llvm-project/commit/ce7356f08194083c205b92e77d1a4cd515a2a5b8.diff

[clang] 6e77ba6 - [clang-format] Fix weird handling of AfterColon

2023-08-23 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2023-08-24T08:34:22+02:00 New Revision: 6e77ba6c1e4d2945a37169f6c7b3531ba39898b5 URL: https://github.com/llvm/llvm-project/commit/6e77ba6c1e4d2945a37169f6c7b3531ba39898b5 DIFF: https://github.com/llvm/llvm-project/commit/6e77ba6c1e4d2945a37169f6c7b3531ba39898b5.diff

[clang] ca0aa53 - [clang-format] Handle Template Arguments with AlignConsecutiveXX

2023-08-29 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2023-08-29T21:59:44+02:00 New Revision: ca0aa533656ceb806d2744c38766f70c317f1053 URL: https://github.com/llvm/llvm-project/commit/ca0aa533656ceb806d2744c38766f70c317f1053 DIFF: https://github.com/llvm/llvm-project/commit/ca0aa533656ceb806d2744c38766f70c317f1053.diff

[clang] [clang-format] modified goto bool to enum (PR #65140)

2023-09-04 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks requested changes to this pull request. Do you actually want to use that feature, or do you only want to work on something? Please take a greater look on how enums are documented, parsed, and tested. A fairly recent example which transitioned from `bool` w

[clang] [clang-format] modified goto bool to enum (PR #65140)

2023-09-04 Thread Björn Schäpers via cfe-commits
@@ -161,7 +171,8 @@ TEST(ConfigParseTest, ParsesConfigurationBools) { CHECK_PARSE_BOOL(IndentAccessModifiers); CHECK_PARSE_BOOL(IndentCaseLabels); CHECK_PARSE_BOOL(IndentCaseBlocks); - CHECK_PARSE_BOOL(IndentGotoLabels); + CHECK_PARSE_ENUM(IndentGotoLabels,

[clang] [clang-format] modified goto bool to enum (PR #65140)

2023-09-04 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/65140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] modified goto bool to enum (PR #65140)

2023-09-04 Thread Björn Schäpers via cfe-commits
@@ -2421,20 +2421,28 @@ struct FormatStyle { /// Indent goto labels. /// - /// When ``false``, goto labels are flushed left. /// \code - ///true: false: - ///int f() { vs. int f() { - /// if (foo

[clang] [clang-format] modified goto bool to enum (PR #65140)

2023-09-04 Thread Björn Schäpers via cfe-commits
@@ -3311,22 +3311,22 @@ the configuration (without a prefix: ``Auto``). .. _IndentGotoLabels: -**IndentGotoLabels** (``Boolean``) :versionbadge:`clang-format 10` :ref:`¶ ` +**IndentGotoLabels** (``enum``) :versionbadge:`clang-format 10` :ref:`¶ ` Indent goto labels. -

[clang] [clang-format] Correctly annotate designated initializer with PP if (PR #65409)

2023-09-06 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/65409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix broken dump_format_help.py and sync the RST file (PR #65429)

2023-09-06 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/65429 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix misannotation of && before noexcept (PR #65526)

2023-09-06 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks created https://github.com/llvm/llvm-project/pull/65526: When we are in an expression, it has to be a binary operator and not pointer of reference. From 7373d5822994616d9fba5d939815c9258d6f9a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A

[clang] [clang-format] Fix misannotation of && before noexcept (PR #65526)

2023-09-06 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks review_requested https://github.com/llvm/llvm-project/pull/65526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Skip additional tests of the same case upon failure (PR #65540)

2023-09-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. Yay https://github.com/llvm/llvm-project/pull/65540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix misannotation of && before noexcept (PR #65526)

2023-09-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks closed https://github.com/llvm/llvm-project/pull/65526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] aff838f - [clang-format][NFC] Remove unneeded braces

2022-11-21 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-11-21T13:24:17+01:00 New Revision: aff838fb8f1d398e8d9fc6ec15b5a10db3e1c057 URL: https://github.com/llvm/llvm-project/commit/aff838fb8f1d398e8d9fc6ec15b5a10db3e1c057 DIFF: https://github.com/llvm/llvm-project/commit/aff838fb8f1d398e8d9fc6ec15b5a10db3e1c057.diff

[clang] c89d2fd - [clang-format][NFC] Format lambda in conditional

2022-11-21 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-11-21T13:24:18+01:00 New Revision: c89d2fd596cec8cf3a8100c504f045b9727fa98a URL: https://github.com/llvm/llvm-project/commit/c89d2fd596cec8cf3a8100c504f045b9727fa98a DIFF: https://github.com/llvm/llvm-project/commit/c89d2fd596cec8cf3a8100c504f045b9727fa98a.diff

[clang] 9e00909 - [clang-format][NFC] Don't add a load of 0es

2022-11-21 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-11-21T13:24:18+01:00 New Revision: 9e00909b00f9e75b4f710bc60f13ceea1215746c URL: https://github.com/llvm/llvm-project/commit/9e00909b00f9e75b4f710bc60f13ceea1215746c DIFF: https://github.com/llvm/llvm-project/commit/9e00909b00f9e75b4f710bc60f13ceea1215746c.diff

[clang] 5ba5f7c - [clang-format][NFC] Removed unused include

2022-11-21 Thread Björn Schäpers via cfe-commits
Author: Björn Schäpers Date: 2022-11-21T13:24:19+01:00 New Revision: 5ba5f7c46ccfe98fd68d6e31d25f386d67d484b4 URL: https://github.com/llvm/llvm-project/commit/5ba5f7c46ccfe98fd68d6e31d25f386d67d484b4 DIFF: https://github.com/llvm/llvm-project/commit/5ba5f7c46ccfe98fd68d6e31d25f386d67d484b4.diff

[clang] [clang-format] Support of TableGen basic format restrictions. (PR #81611)

2024-02-14 Thread Björn Schäpers via cfe-commits
@@ -55,5 +59,271 @@ TEST_F(FormatTestTableGen, NoSpacesInSquareBracketLists) { verifyFormat("def flag : Flag<[\"-\", \"--\"], \"foo\">;"); } +TEST_F(FormatTestTableGen, LiteralsAndIdentifiers) { + verifyFormat("def LiteralAndIdentifiers {\n" + " let someInteg

[clang] [clang-format] Support of TableGen basic format restrictions. (PR #81611)

2024-02-15 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/81611 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-01 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks commented: Could you please add a note to `clang/docs/ReleaseNotes.rst`. https://github.com/llvm/llvm-project/pull/95013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-03 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/95013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Skip block commented out includes when sorting them (PR #97787)

2024-07-05 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/97787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Annotate function decl l_paren (PR #97938)

2024-07-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/97938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate braces in macro definition (PR #107352)

2024-09-04 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/107352 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clang-format] Add support for BasedOnStyle referencing an arbitrary file (PR #107312)

2024-09-04 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/107312 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [llvm] [clang-format] Add support for BasedOnStyle referencing an arbitrary file (PR #107312)

2024-09-04 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks commented: You are touching a lot of projects. I don't know how others feel about that, but my preference would be to tackle one project per PR. https://github.com/llvm/llvm-project/pull/107312 ___ cfe-commits mai

[clang] [clang-tools-extra] [llvm] [clang-format] Add support for BasedOnStyle referencing an arbitrary file (PR #107312)

2024-09-04 Thread Björn Schäpers via cfe-commits
@@ -109,6 +110,9 @@ class ChangeNamespaceTool : public ast_matchers::MatchFinder::MatchCallback { }; std::string FallbackStyle; + // Specifies the list of paths to be searched when FormatStyle or a BasedOnStyle + // in a .clang-format file specifies an arbitrary file t

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-09-05 Thread Björn Schäpers via cfe-commits
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

[clang] [clang-format] Fix a bug in annotating CastRParen (PR #107675)

2024-09-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/107675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Adjust requires clause wrapping (#101550) (PR #102078)

2024-08-09 Thread Björn Schäpers via cfe-commits
@@ -25831,19 +25843,108 @@ TEST_F(FormatTest, RequiresClausesPositions) { verifyFormat("template \n" "int S::bar(T t) &&\n" - "requires F {\n" + "requires F\n" + "{\n" " return 5;\n" "}

[clang] [clang-format] Adjust requires clause wrapping (#101550) (PR #102078)

2024-08-09 Thread Björn Schäpers via cfe-commits
@@ -25831,19 +25843,108 @@ TEST_F(FormatTest, RequiresClausesPositions) { verifyFormat("template \n" "int S::bar(T t) &&\n" - "requires F {\n" + "requires F\n" + "{\n" " return 5;\n" "}

[clang] [clang-format] Adjust requires clause wrapping (#101550) (PR #102078)

2024-08-09 Thread Björn Schäpers via cfe-commits
@@ -5682,12 +5683,15 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, (Style.BreakTemplateDeclarations == FormatStyle::BTDS_Leave && Right.NewlinesBefore > 0); } - if (Left.ClosesRequiresClause && Right.isNot(tok::semi) && - Rig

[clang] [clang-format] Fix a serious bug in `git clang-format -f` (PR #102629)

2024-08-09 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/102629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add BreakBinaryOperations configuration (PR #95013)

2024-08-10 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: Nah, I can't find a better name, which isn't a whole sentence. https://github.com/llvm/llvm-project/pull/95013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Adjust requires clause wrapping (#101550) (PR #102078)

2024-08-12 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/102078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fixes and closes issues, #53390 and #58710. Added new controls to IndentNamespaceAliases, IndentUsingDeclarations and DecorateReflowedComments. (PR #102894)

2024-08-12 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/102894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fixes and closes issues, #53390 and #58710. Added new controls to IndentNamespaceAliases, IndentUsingDeclarations and DecorateReflowedComments. (PR #102894)

2024-08-12 Thread Björn Schäpers via cfe-commits
@@ -47,8 +47,7 @@ void printLine(llvm::raw_ostream &OS, const UnwrappedLine &Line, OS << Prefix; NewLine = false; } -OS << I->Tok->Tok.getName() << "[" - << "T=" << (unsigned)I->Tok->getType() +OS << I->Tok->Tok.getName() << "[" << "T=" << (unsign

[clang] Fixes and closes issues, #53390 and #58710. Added new controls to IndentNamespaceAliases, IndentUsingDeclarations and DecorateReflowedComments. (PR #102894)

2024-08-12 Thread Björn Schäpers via cfe-commits
@@ -346,6 +345,35 @@ bool UnwrappedLineParser::precededByCommentOrPPDirective() const { (Previous->IsMultiline || Previous->NewlinesBefore > 0); } +void UnwrappedLineParser::parseStmt(bool keepIndentation) { + bool levelsAreAdded = (Line->Level == DeclarationScopeSt

[clang] Fixes and closes issues, #53390 and #58710. Added new controls to IndentNamespaceAliases, IndentUsingDeclarations and DecorateReflowedComments. (PR #102894)

2024-08-12 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks requested changes to this pull request. First of all you need a better title for your change, beginning with "[clang-format]" Second of all, could you please split this in multiple reviews? Third of all, you need to add tests. https://github.com/llvm/llvm

[clang] Fixes and closes issues, #53390 and #58710. Added new controls to IndentNamespaceAliases, IndentUsingDeclarations and DecorateReflowedComments. (PR #102894)

2024-08-12 Thread Björn Schäpers via cfe-commits
@@ -465,6 +493,9 @@ bool UnwrappedLineParser::parseLevel(const FormatToken *OpeningBrace, SwitchLabelEncountered = true; parseStructuralElement(); break; +case tok::kw_using: + parseStmt(Style.IndentUsingDeclarations); HazardyKnusper

[clang] Fixes and closes issues, #53390 and #58710. Added new controls to IndentNamespaceAliases, IndentUsingDeclarations and DecorateReflowedComments. (PR #102894)

2024-08-12 Thread Björn Schäpers via cfe-commits
@@ -5104,6 +5144,9 @@ struct FormatStyle { IndentCaseBlocks == R.IndentCaseBlocks && IndentCaseLabels == R.IndentCaseLabels && IndentExternBlock == R.IndentExternBlock && + IndentNamespaceAliases == R.IndentNamespaceAliases && +

[clang] Fixes and closes issues, #53390 and #58710. Added new controls to IndentNamespaceAliases, IndentUsingDeclarations and DecorateReflowedComments. (PR #102894)

2024-08-12 Thread Björn Schäpers via cfe-commits
@@ -2822,6 +2822,46 @@ struct FormatStyle { /// \version 11 IndentExternBlockStyle IndentExternBlock; + /// IndentNamespaceAliases is the type of indenting of namespace aliases + /// irrespective of NamespaceIndentation. + bool IndentNamespaceAliases; H

[clang] Fixes and closes issues, #53390 and #58710. Added new controls to IndentNamespaceAliases, IndentUsingDeclarations and DecorateReflowedComments. (PR #102894)

2024-08-12 Thread Björn Schäpers via cfe-commits
@@ -346,6 +345,35 @@ bool UnwrappedLineParser::precededByCommentOrPPDirective() const { (Previous->IsMultiline || Previous->NewlinesBefore > 0); } +void UnwrappedLineParser::parseStmt(bool keepIndentation) { + bool levelsAreAdded = (Line->Level == DeclarationScopeSt

[clang] Fixes and closes issues, #53390 and #58710. Added new controls to IndentNamespaceAliases, IndentUsingDeclarations and DecorateReflowedComments. (PR #102894)

2024-08-12 Thread Björn Schäpers via cfe-commits
@@ -2822,6 +2822,46 @@ struct FormatStyle { /// \version 11 IndentExternBlockStyle IndentExternBlock; + /// IndentNamespaceAliases is the type of indenting of namespace aliases + /// irrespective of NamespaceIndentation. + bool IndentNamespaceAliases; + + /// IndentUsi

[clang] [clang-format] Correctly handle C# attribute on auto property (PR #102921)

2024-08-12 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/102921 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Add getNextNonComment() to FormatTokenSource (PR #87868)

2024-04-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/87868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Added unittest of TableGen formatting w.r.t. block type calculation. (PR #87924)

2024-04-07 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/87924 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [polly] [clang-format] Correctly annotate braces in macros (PR #87953)

2024-04-09 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/87953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't merge a short block for SBS_Never (PR #88238)

2024-04-10 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/88238 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add txtpb to the list of supported TextProto extensions (PR #88355)

2024-04-11 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/88355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a regression in ContinuationIndenter (PR #88414)

2024-04-11 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/88414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add txtpb to the list of supported TextProto extensions (PR #88355)

2024-04-12 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks closed https://github.com/llvm/llvm-project/pull/88355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-12 Thread Björn Schäpers via cfe-commits
@@ -5598,10 +5598,34 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, // FIXME: Breaking after newlines seems useful in general. Turn this into an // option and recognize more cases like endl etc, and break independent of // what comes after operator le

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-12 Thread Björn Schäpers via cfe-commits
@@ -2193,6 +2193,41 @@ struct FormatStyle { /// \version 3.7 bool BreakBeforeTernaryOperators; + /// Different ways to Break Between Chevrons. + enum BreakChevronOperatorStyle : int8_t { +/// Break using ColumnLimit rules. +/// \code +/// os << "a" << "

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-12 Thread Björn Schäpers via cfe-commits
@@ -5598,10 +5598,34 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, // FIXME: Breaking after newlines seems useful in general. Turn this into an // option and recognize more cases like endl etc, and break independent of // what comes after operator le

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-12 Thread Björn Schäpers via cfe-commits
@@ -2193,6 +2193,41 @@ struct FormatStyle { /// \version 3.7 bool BreakBeforeTernaryOperators; + /// Different ways to Break Between Chevrons. + enum BreakChevronOperatorStyle : int8_t { +/// Break using ColumnLimit rules. +/// \code +/// os << "a" << "

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-12 Thread Björn Schäpers via cfe-commits
@@ -2193,6 +2193,41 @@ struct FormatStyle { /// \version 3.7 bool BreakBeforeTernaryOperators; + /// Different ways to Break Between Chevrons. + enum BreakChevronOperatorStyle : int8_t { +/// Break using ColumnLimit rules. +/// \code +/// os << "a" << "

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-12 Thread Björn Schäpers via cfe-commits
@@ -5598,10 +5598,34 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, // FIXME: Breaking after newlines seems useful in general. Turn this into an // option and recognize more cases like endl etc, and break independent of // what comes after operator le

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-13 Thread Björn Schäpers via cfe-commits
@@ -5598,10 +5598,34 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, // FIXME: Breaking after newlines seems useful in general. Turn this into an // option and recognize more cases like endl etc, and break independent of // what comes after operator le

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-13 Thread Björn Schäpers via cfe-commits
@@ -2193,6 +2193,41 @@ struct FormatStyle { /// \version 3.7 bool BreakBeforeTernaryOperators; + /// Different ways to Break Between Chevrons. + enum BreakChevronOperatorStyle : int8_t { +/// Break using ColumnLimit rules. +/// \code +/// os << "a" << "

[clang] [clang-format] revert to string << string handling to previous default (PR #88490)

2024-04-13 Thread Björn Schäpers via cfe-commits
@@ -5598,11 +5598,45 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line, // FIXME: Breaking after newlines seems useful in general. Turn this into an // option and recognize more cases like endl etc, and break independent of // what comes after operator le

[clang] [clang-format] Don't format comments in SkipMacroDefinitionBody (PR #94425)

2024-06-05 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/94425 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Remove an else after a return statement (PR #94548)

2024-06-06 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/94548 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] fix incorrectly indents lambda trailing return (PR #94560)

2024-06-06 Thread Björn Schäpers via cfe-commits
@@ -1457,6 +1457,11 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) { !Current.isOneOf(tok::colon, tok::comment)) { return ContinuationIndent; } + if (Style.isCpp() && Current.is(tok::arrow) && HazardyKnusperkeks wrote:

[clang] [clang-format] fix incorrectly indents lambda trailing return (PR #94560)

2024-06-06 Thread Björn Schäpers via cfe-commits
@@ -22858,6 +22858,31 @@ TEST_F(FormatTest, FormatsLambdas) { " //\n" "});"); + verifyFormat("int main() {\n" HazardyKnusperkeks wrote: Get yourself a style with a lower column limit `auto Style = getLLVMStyleWithColumnLimit(40);` and u

[clang] [clang-format] Fix a bug in `AlignAfterOpenBracket: DontAlign` (PR #94561)

2024-06-06 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/94561 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2024-06-06 Thread Björn Schäpers via cfe-commits
@@ -187,7 +187,6 @@ TEST(ConfigParseTest, ParsesConfigurationBools) { CHECK_PARSE_BOOL(RemoveSemicolon); CHECK_PARSE_BOOL(SkipMacroDefinitionBody); CHECK_PARSE_BOOL(SpacesInSquareBrackets); - CHECK_PARSE_BOOL(SpaceInEmptyBlock); HazardyKnusperkeks wrote:

[clang] [clang-format] fix incorrectly indents lambda trailing return (PR #94560)

2024-06-07 Thread Björn Schäpers via cfe-commits
@@ -22858,6 +22858,31 @@ TEST_F(FormatTest, FormatsLambdas) { " //\n" "});"); + verifyFormat("int main() {\n" HazardyKnusperkeks wrote: Cache the style and re use it. https://github.com/llvm/llvm-project/pull/94560 _

[clang] [clang-format] fix incorrectly indents lambda trailing return (PR #94560)

2024-06-07 Thread Björn Schäpers via cfe-commits
@@ -1457,7 +1457,7 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) { !Current.isOneOf(tok::colon, tok::comment)) { return ContinuationIndent; } - if (Style.isCpp() && Current.is(tok::arrow) && + if (Style.isCpp() && Current.is(TT_Traili

[clang] [clang-format] Fix bad comment indentation before ifdef after braceless if (PR #94776)

2024-06-07 Thread Björn Schäpers via cfe-commits
@@ -796,6 +796,24 @@ TEST_F(FormatTestComments, ParsesCommentsAdjacentToPPDirectives) { format("namespace {}\n /* Test */#define A")); } + +TEST_F(FormatTestComments, DeIdentsCommentBeforeIfdefAfterBracelessIf) { + EXPECT_EQ("void f() {\n"

[clang] [clang-format] Fix bad comment indentation before ifdef after braceless if (PR #94776)

2024-06-07 Thread Björn Schäpers via cfe-commits
@@ -4736,6 +4738,7 @@ void UnwrappedLineParser::distributeComments( // the two lines about b form a maximal trail, so there are two sections, the // first one consisting of the single comment "// line about a" and the // second one consisting of the next two comments. + -

[clang] [clang-format] Fix bad comment indentation before ifdef after braceless if (PR #94776)

2024-06-07 Thread Björn Schäpers via cfe-commits
@@ -4828,7 +4834,11 @@ void UnwrappedLineParser::readToken(int LevelDifference) { PPBranchLevel > 0) { Line->Level += PPBranchLevel; } - flushComments(isOnNewLine(*FormatTok)); + + if (!UnBracedBodyDepth) { HazardyKnusperkeks

[clang] [clang-format] Fix bad comment indentation before ifdef after braceless if (PR #94776)

2024-06-07 Thread Björn Schäpers via cfe-commits
@@ -338,6 +338,9 @@ class UnwrappedLineParser { // `decltype(auto)`. bool IsDecltypeAutoFunction = false; + + int UnBracedBodyDepth = 0; HazardyKnusperkeks wrote: Could you add some documentation? https://github.com/llvm/llvm-project/pull/94776

[clang] [clang-format] fix incorrectly indents lambda trailing return (PR #94560)

2024-06-08 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request. https://github.com/llvm/llvm-project/pull/94560 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add option to remove leading blank lines (PR #91221)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -208,6 +208,9 @@ RawStringFormatStyleManager::RawStringFormatStyleManager( LanguageStyle = PredefinedStyle; } LanguageStyle->ColumnLimit = CodeStyle.ColumnLimit; +// This way the first line of the string does not have to follow the code +// before the s

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -1203,6 +1214,10 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State, } } + if (!Style.BinPackBinaryOperations && Previous.is(TT_BinaryOperator) && HazardyKnusperkeks wrote: Couldn't you just call `startsNextOperand`? https://gith

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -146,6 +146,14 @@ static bool startsNextParameter(const FormatToken &Current, Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma)); } +// Returns \c true if \c Current starts a new operand in a binary operation. +static bool startsNextOperand(const Forma

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyle(); + Style.BinPackBinaryOperations = false; + + // Logical operations + verifyF

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyle(); + Style.BinPackBinaryOperations = false; + + // Logical operations + verifyF

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Björn Schäpers via cfe-commits
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BinPackBinaryOperations) { + auto Style = getLLVMStyle(); + Style.BinPackBinaryOperations = false; + + // Logical operations + verifyF

[clang] [clang-format] Don't count template template parameter as declaration (PR #95025)

2024-06-11 Thread Björn Schäpers via cfe-commits
https://github.com/HazardyKnusperkeks edited https://github.com/llvm/llvm-project/pull/95025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    1   2   3   4   5   6   7   8   9   >