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

[PATCH v2 1/3] clang-format: change column limit to 96 characters

From
Karthik Nayak <karthik.188@gmail.com>
Date
Oct 10, 2024, 17:59 UTC
Message-ID
<e22ffbe0f65971579809d817984766af12898127.1728582927.git.karthik.188@gmail.com>
In-Reply-To
<cover.1728582927.git.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 96 instead. This provides some slack so we can ensure readability takes preference over the 80 character hard limit.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
---
 .clang-format | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/.clang-format b/.clang-format
index 41969eca4b..684ab32d28 100644
--- a/.clang-format
+++ b/.clang-format
@@ -12,7 +12,10 @@ UseTab: Always
 TabWidth: 8
 IndentWidth: 8
 ContinuationIndentWidth: 8
-ColumnLimit: 80
+
+# While we recommend keeping column limit to 80, we want to also provide
+# some slack to maintain readability.
+ColumnLimit: 96
 
 # C Language specifics
 Language: Cpp
-- 
2.47.0
Previous: Karthik NayakNext: Kyle Lippincott
Message 2 of 7 in “clang-format: fix rules to make the CI job cleaner”
  1. 0/3 clang-format: fix rules to make the CI job cleanerKarthik Nayak, Oct 10, 2024
  2. 1/3 clang-format: change column limit to 96 charactersKarthik Nayak, Oct 10, 2024
  3. Kyle LippincottOct 10, 2024
  4. karthik nayakOct 10, 2024
  5. Kyle LippincottOct 10, 2024
  6. 2/3 clang-format: don't align expressions after linebreaksKarthik Nayak, Oct 10, 2024
  7. 3/3 clang-format: align consecutive macro definitionsKarthik Nayak, Oct 10, 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.