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

Re: .clang-format: how useful, how often used, and how well maintained?

From
Karthik Nayak <karthik.188@gmail.com>
Date
Jun 24, 2025, 23:27 UTC
Message-ID
<CAOLa=ZQmsa22LcjeJSScSHHGz4AzCkJd74H1auLdq31AVPoGxA@mail.gmail.com>
In-Reply-To
<xmqq34bq77b8.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 22 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>>> For that, there are a few things we'd probably need to do:
>>>
>>>  - Improve our tooling so that the develper can check a range of
>>>    commits they made before running format-patch, and other
>>>    situations.
>>>
>>>  - Improve .clang-format rules to reduce false positives.
>>>
>>
>> I think the biggest issue for this is around line wrapping, I'm
>> considering just removing it from the '.clang-format'. Perhaps we could
>> add it to our '.editorconfig'?
>
> I would not stop others from trying to improve the rules in such a
> way that only an overly long lines (like >120 columns) are folded to
> reasonable length (line ~72 columns) without doing anything else
> (like not concatenating adjacent lines only because the result would
> be shorter than 80 columns), but if it is more involved than we can
> manage, removing it from .clang-format so that "make style" would
> not use would be the best (or "the least bad") approach.

Agreed. I would definitely like to see us solve this issue eventually. For now, perhaps removing false positives is just more beneficial.

Let me send in some patches and we can see what everyone thinks.
Previous: Junio C Hamano
Message 18 of 18 in “.clang-format: how useful, how often used, and how well maintained?”
  1. Junio C HamanoJun 19, 2025
  2. Christian CouderJun 19, 2025
  3. Junio C HamanoJun 20, 2025
  4. Christian CouderJun 20, 2025
  5. Junio C HamanoJun 20, 2025
  6. Jeff KingJun 21, 2025
  7. Junio C HamanoJun 22, 2025
  8. brian m. carlsonJun 19, 2025
  9. Collin FunkJun 19, 2025
  10. brian m. carlsonJun 19, 2025
  11. Junio C HamanoJun 20, 2025
  12. Toon ClaesJul 1, 2025
  13. Johannes SchindelinJul 1, 2025
  14. Junio C HamanoJul 1, 2025
  15. Junio C HamanoJul 1, 2025
  16. Karthik NayakJun 23, 2025
  17. Junio C HamanoJun 23, 2025
  18. Karthik NayakJun 24, 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.