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

Re: [PATCH 1/4] editorconfig: set maximum line length to 120 characters

From
Karthik Nayak <karthik.188@gmail.com>
Date
Jun 27, 2025, 08:38 UTC
Message-ID
<CAOLa=ZRrBS9Jzf_p_cLOhB+meSTmQ8=MF67A_tihLZ-qpj42Aw@mail.gmail.com>
In-Reply-To
<xmqqbjqar35m.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 25 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>> So my intent was to instead was to allow the user to be in charge of
>> line-wrapping, but for no reason should that go beyond 120 columns.
>>
>> I'm happy to change that to 80 columns, this does mean that supported
>> editors will start wrapping at 80 columns. Users will have to override
>> as necessary.
>
> OK.  So stepping back a bit
>
>  1. We advise people to avoid exceeding 80 columns
>
>  2. A line can be easier to read without wrapping strictly at 80
>     columns but left as a single line, slightly going above the
>     limit..
>
>  3. Even with the second observation above, a line that is way
>     longer than 80 columns is not acceptably long.
>
> Now, what is the line between the #2 and #3?  If we set these "hard
> limit" to that number, as long as the tool does not pack multiple
> shorter lines into one line using that number as a limit, we'd be at
> a happy place, I would imagine?
>
Spot on. Doing some backhand analysis on our code base:

Total lines: 2136626 Max length: 904 Average length: 36.2 Median length: 32.0 90th percentile: 73.0 95th percentile: 79.0

Lines > 80 chars: 91650 (4.3%) Lines > 100 chars: 54589 (2.6%) Lines > 120 chars: 35529 (1.7%)

The `max_line_length` in '.editorconfig' is stated as:
  Forces hard line wrapping after the amount of characters specified.
  unset to turn off this feature (use the editor settings).

So it doesn't force packing shorter lines together, rather, only wraps lines above the specified limit. This limit can be thought of the limit beyond which a line is of unacceptable length. We can move this lower to perhaps 100 or even 80, but that would force line wrapping at 80 characters. Which can be great, but there are situations like you mentioned where we want to extend.

> Thanks.
Previous: Junio C HamanoNext: Justin Tobler
Message 6 of 36 in “clang-format: modify rules to reduce false-positives”
  1. 0/4 clang-format: modify rules to reduce false-positivesKarthik Nayak, Jun 25, 2025
  2. 1/4 editorconfig: set maximum line length to 120 charactersKarthik Nayak, Jun 25, 2025
  3. Junio C HamanoJun 25, 2025
  4. Karthik NayakJun 26, 2025
  5. Junio C HamanoJun 26, 2025
  6. Karthik NayakJun 27, 2025
  7. Justin ToblerJun 26, 2025
  8. Karthik NayakJun 27, 2025
  9. Justin ToblerJun 27, 2025
  10. Karthik NayakJun 30, 2025
  11. 2/4 clang-format: set 'ColumnLimit' to 0Karthik Nayak, Jun 25, 2025
  12. 3/4 clang-format: add 'RemoveBracesLLVM' to the main configKarthik Nayak, Jun 25, 2025
  13. 4/4 meson: add rule to run 'git clang-format'Karthik Nayak, Jun 25, 2025
  14. Justin ToblerJun 26, 2025
  15. Karthik NayakJun 27, 2025
  16. Junio C HamanoJun 27, 2025
  17. Karthik NayakJun 30, 2025
  18. Junio C HamanoJun 30, 2025
  19. 0/3 clang-format: modify rules to reduce false-positivesKarthik Nayak, Jun 30, 2025
  20. 1/3 clang-format: set 'ColumnLimit' to 0Karthik Nayak, Jun 30, 2025
  21. 2/3 clang-format: add 'RemoveBracesLLVM' to the main configKarthik Nayak, Jun 30, 2025
  22. 3/3 meson: add rule to run 'git clang-format'Karthik Nayak, Jun 30, 2025
  23. Patrick SteinhardtJul 1, 2025
  24. Karthik NayakJul 1, 2025
  25. Junio C HamanoJul 1, 2025
  26. Toon ClaesJul 1, 2025
  27. Karthik NayakJul 1, 2025
  28. Patrick SteinhardtJul 2, 2025
  29. Junio C HamanoJun 30, 2025
  30. Toon ClaesJul 1, 2025
  31. Karthik NayakJul 1, 2025
  32. Junio C HamanoJul 1, 2025
  33. 0/3 clang-format: modify rules to reduce false-positivesKarthik Nayak, Jul 2, 2025
  34. 1/3 clang-format: set 'ColumnLimit' to 0Karthik Nayak, Jul 2, 2025
  35. 2/3 clang-format: add 'RemoveBracesLLVM' to the main configKarthik Nayak, Jul 2, 2025
  36. 3/3 meson: add rule to run 'git clang-format'Karthik Nayak, Jul 2, 2025

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.