[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/118409 >From 86bc2d2fe03d84879870eec1a8c10912076686c2 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Mon, 2 Dec 2024 15:16:39 -0700 Subject: [PATCH 1/7] [clang-format] Add PenaltyBreakBeforeMemberAccess Add a config

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/118409 >From 86bc2d2fe03d84879870eec1a8c10912076686c2 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Mon, 2 Dec 2024 15:16:39 -0700 Subject: [PATCH 1/6] [clang-format] Add PenaltyBreakBeforeMemberAccess Add a config

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Owen Pan via cfe-commits
@@ -22365,6 +22365,19 @@ TEST_F(FormatTest, BreakPenaltyAfterForLoopLParen) { Style); } +TEST_F(FormatTest, BreakPenaltyBeforeMemberAccess) { owenca wrote: I was looking at the option names, not the test names. Please ignore this request if yo

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Owen Pan via cfe-commits
https://github.com/owenca deleted https://github.com/llvm/llvm-project/pull/118409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Owen Pan via cfe-commits
@@ -22365,6 +22365,29 @@ TEST_F(FormatTest, BreakPenaltyAfterForLoopLParen) { Style); } +TEST_F(FormatTest, BreakPenaltyBeforeMemberAccess) { + auto Style = getLLVMStyle(); + EXPECT_EQ(Style.PenaltyBreakBeforeMemberAccess, 150u); + + Style.ColumnLimit = 60; +

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Owen Pan via cfe-commits
@@ -22365,6 +22365,19 @@ TEST_F(FormatTest, BreakPenaltyAfterForLoopLParen) { Style); } +TEST_F(FormatTest, BreakPenaltyBeforeMemberAccess) { owenca wrote: I was looking at the option names, not the test names. Please ignore this request if yo

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Gedare Bloom via cfe-commits
@@ -4316,7 +4316,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line, // aaa // .a.(); return !Right.NextOperator || !Right.NextOperator->Previous->closesScope() - ? 150 + ? Style.Pena

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Gedare Bloom via cfe-commits
@@ -22365,6 +22365,19 @@ TEST_F(FormatTest, BreakPenaltyAfterForLoopLParen) { Style); } +TEST_F(FormatTest, BreakPenaltyBeforeMemberAccess) { + FormatStyle Style = getLLVMStyle(); + Style.ColumnLimit = 8; + Style.PenaltyExcessCharacter = 15; + verifyFormat("

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/118409 >From 86bc2d2fe03d84879870eec1a8c10912076686c2 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Mon, 2 Dec 2024 15:16:39 -0700 Subject: [PATCH 1/5] [clang-format] Add PenaltyBreakBeforeMemberAccess Add a config

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/118409 >From 86bc2d2fe03d84879870eec1a8c10912076686c2 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Mon, 2 Dec 2024 15:16:39 -0700 Subject: [PATCH 1/4] [clang-format] Add PenaltyBreakBeforeMemberAccess Add a config

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Gedare Bloom via cfe-commits
@@ -4316,7 +4316,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line, // aaa // .a.(); return !Right.NextOperator || !Right.NextOperator->Previous->closesScope() - ? 150 + ? Style.Pena

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Gedare Bloom via cfe-commits
@@ -22365,6 +22365,19 @@ TEST_F(FormatTest, BreakPenaltyAfterForLoopLParen) { Style); } +TEST_F(FormatTest, BreakPenaltyBeforeMemberAccess) { gedare wrote: I'm confused by the sorting request. I put it where it is lexicographically sorted. ht

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Owen Pan via cfe-commits
@@ -22365,6 +22365,19 @@ TEST_F(FormatTest, BreakPenaltyAfterForLoopLParen) { Style); } +TEST_F(FormatTest, BreakPenaltyBeforeMemberAccess) { owenca wrote: Please move up this test to line 22307 to keep the `PenaltyBreak...` options (kind of)

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Owen Pan via cfe-commits
@@ -4316,7 +4316,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line, // aaa // .a.(); return !Right.NextOperator || !Right.NextOperator->Previous->closesScope() - ? 150 + ? Style.Pena

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-27 Thread Owen Pan via cfe-commits
@@ -22365,6 +22365,19 @@ TEST_F(FormatTest, BreakPenaltyAfterForLoopLParen) { Style); } +TEST_F(FormatTest, BreakPenaltyBeforeMemberAccess) { + FormatStyle Style = getLLVMStyle(); + Style.ColumnLimit = 8; + Style.PenaltyExcessCharacter = 15; + verifyFormat("

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-22 Thread Gedare Bloom via cfe-commits
gedare wrote: > Please rebase and run `ninja clang-format-style`. Done. https://github.com/llvm/llvm-project/pull/118409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2025-01-22 Thread Gedare Bloom via cfe-commits
https://github.com/gedare updated https://github.com/llvm/llvm-project/pull/118409 >From 978e0415002be5ee51d226d15121392a8a0c2c85 Mon Sep 17 00:00:00 2001 From: Gedare Bloom Date: Mon, 2 Dec 2024 15:16:39 -0700 Subject: [PATCH 1/3] [clang-format] Add PenaltyBreakBeforeMemberAccess Add a config

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2024-12-19 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: Please rebase and run `ninja clang-format-style`. https://github.com/llvm/llvm-project/pull/118409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2024-12-18 Thread via cfe-commits
https://github.com/mydeveloperday approved this pull request. https://github.com/llvm/llvm-project/pull/118409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

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

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2024-12-02 Thread Gedare Bloom via cfe-commits
https://github.com/gedare edited https://github.com/llvm/llvm-project/pull/118409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2024-12-02 Thread Gedare Bloom via cfe-commits
@@ -4280,7 +4280,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line, // aaa // .a.(); return !Right.NextOperator || !Right.NextOperator->Previous->closesScope() - ? 150 + ? Style.Pena

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2024-12-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Gedare Bloom (gedare) Changes The penalty for breaking before a member access is hard-coded to 150. Add a configuration option to allow setting it. --- Full diff: https://github.com/llvm/llvm-project/pull/118409.diff 7 Files Affe

[clang] Add configuration option PenaltyBreakBeforeMemberAccess (PR #118409)

2024-12-02 Thread Gedare Bloom via cfe-commits
https://github.com/gedare created https://github.com/llvm/llvm-project/pull/118409 The penalty for breaking before a member access is hard-coded to 150. Add a configuration option to allow setting it. >From dfa4d88b072e99c1c425b85003090a46ca4ec252 Mon Sep 17 00:00:00 2001 From: Gedare Bloom D