git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Karthik Nayak <karthik.188@gmail.com>
Date
Oct 9, 2024, 12:51 UTC
Message-ID
<CAOLa=ZQrCxU_tUcFsrAjTxq2ufCNk=zox-fsa_KMenyCJr5gUg@mail.gmail.com>
In-Reply-To
<20241009125109.24422-1-karthik.188@gmail.com>

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(-)
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
Next: Karthik Nayak
Message 1 of 2 in “clang-format: don't enforce the column limit”
  1. 1/3 clang-format: don't enforce the column limitKarthik Nayak, Oct 9, 2024
  2. Karthik NayakOct 9, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.