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

Re: [RFC PATCH 3/4] .clang-format: do not enforce a ColumnLimit

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jul 11, 2022, 22:39 UTC
Message-ID
<YsymlrUviwwoKHZX@tapette.crustytoothpaste.net>
In-Reply-To
<RFC-patch-3.4-06d4b76a364-20220711T110019Z-avarab@gmail.com>
On 2022-07-11 at 11:37:27, Ævar Arnfjörð Bjarmason wrote:
Show 17 quoted lines
> Our Documentation/CodingGuidelines mention that "We try to keep to at
> most 80 characters per line", but in reality we have a lot of code
> that runs afoul of that rule.
> 
> Before & after this change running "make style-all-diff-apply" will
> yield:
> 
> 	579 files changed, 32065 insertions(+), 29818 deletions(-)
> 	509 files changed, 13042 insertions(+), 12745 deletions(-)
> 
> As with the preceding change what this leaves us with an unresolved
> question though, should we have some stricter version of "make
> style-all" that incorporates "ColumnLimit: 80", or perhaps apply it
> only on "make style", but then what if someone modifies code that
> happens to e.g. search/replace a line running afoul of the limit?
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

As mentioned upthread, I am fine with an 80-character limit. It's a reasonable choice and what's we've traditionally done.

However, I don't think we should drop a limit altogether unless we're going to not bother people about this in code review. I would say that if people are going to want a limit on line length, then we should pick one.

Now, we could well pick one that's longer than 80 characters. 132 is a common terminal size and it would avoid needing to rewrap all of those lines. But sticking with 80 columns is also fine, and we'll just need to send some patches accordingly.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 19 of 27 in “Automatic code formatting”
  1. brian m. carlsonJul 10, 2022
  2. Junio C HamanoJul 10, 2022
  3. rsbecker@nexbridge.comJul 10, 2022
  4. brian m. carlsonJul 11, 2022
  5. rsbecker@nexbridge.comJul 11, 2022
  6. Elijah NewrenJul 11, 2022
  7. Ævar Arnfjörð BjarmasonJul 11, 2022
  8. Elijah NewrenJul 11, 2022
  9. 0/4 make headway towards a clean "clang-format"Ævar Arnfjörð Bjarmason, Jul 11, 2022
  10. 2/4 .clang-format: Add a BitFieldColonSpacing=None ruleÆvar Arnfjörð Bjarmason, Jul 11, 2022
  11. brian m. carlsonJul 11, 2022
  12. Junio C HamanoJul 11, 2022
  13. Ævar Arnfjörð BjarmasonJul 12, 2022
  14. Tuomas AholaSep 11, 2026
  15. 1/4 Makefile: add a style-all targets for .clang-format testingÆvar Arnfjörð Bjarmason, Jul 11, 2022
  16. 3/4 .clang-format: do not enforce a ColumnLimitÆvar Arnfjörð Bjarmason, Jul 11, 2022
  17. Junio C HamanoJul 11, 2022
  18. Ævar Arnfjörð BjarmasonJul 12, 2022
  19. brian m. carlsonJul 11, 2022
  20. Junio C HamanoJul 11, 2022
  21. Eric SunshineJul 11, 2022
  22. Junio C HamanoJul 11, 2022
  23. 4/4 .clang-format: don't indent "goto" labelsÆvar Arnfjörð Bjarmason, Jul 11, 2022
  24. Junio C HamanoJul 11, 2022
  25. Ævar Arnfjörð BjarmasonJul 12, 2022
  26. Phillip WoodJul 11, 2022
  27. Ævar Arnfjörð BjarmasonJul 11, 2022

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.