threads / patch / 62295

patch, 3 partsclang-format: don't enforce the column limit

Subject: [PATCH 1/3] clang-format: don't enforce the column limit

## tl;dr

2 messages between Oct 9, 2024 and Oct 9, 2024. Diffs are folded; open one to read it.

replies: 1people: 1as markdown or json

Karthik Nayak· Oct 9, 2024, 12:51 UTC · lore

The current value for the column limit is set to 80. While this is as expected, we often prefer readability over this strict limit. This means it is common to find code which extends over 80 characters. So let's change the column limit to be 0 instead. This ensures that the formatter doesn't complain about code strictly not following the column limit.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
---
 .clang-format | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Show changes to .clang-format +5 −1
diff --git a/.clang-format b/.clang-format
index 41969eca4b..38910a3a53 100644
--- a/.clang-format
+++ b/.clang-format
@@ -12,7 +12,11 @@ UseTab: Always
 TabWidth: 8
 IndentWidth: 8
 ContinuationIndentWidth: 8
-ColumnLimit: 80
+
+# While we recommend keeping column limit to 80, we don't want to
+# enforce it as we generally are more lenient with this rule and
+# prefer to prioritize readability.
+ColumnLimit: 0

 # C Language specifics
 Language: Cpp
-- 
2.46.2
Karthik Nayak· Oct 9, 2024, 12:58 UTC · re: Karthik Nayak · lore

Re: [PATCH 1/3] clang-format: don't enforce the column limit

Karthik Nayak <karthik.188@gmail.com> writes:
Show 6 quoted lines
> The current value for the column limit is set to 80. While this is as
> expected, we often prefer readability over this strict limit. This means
> it is common to find code which extends over 80 characters. So let's
> change the column limit to be 0 instead. This ensures that the formatter
> doesn't complain about code strictly not following the column limit.
>

Seems like this mail got double posted, please ignore. The original thread [1] has the full set of patches.

[1]: https://lore.kernel.org/git/CAOLa=ZRvFBhageS65uE5enzLBz7H_CAvvnEcPsi_QAi0exRx2w@mail.gmail.com/#r

← back to recent threads