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

Re: [PATCH v2 0/3] clang-format: modify rules to reduce false-positives

From
Karthik Nayak <karthik.188@gmail.com>
Date
Jul 1, 2025, 15:19 UTC
Message-ID
<CAOLa=ZQr=JfKES6vMfROLsvO0egjwNun6oGkwJsN9_TkQkt3rg@mail.gmail.com>
In-Reply-To
<878ql8qbhp.fsf@iotcl.com>
Toon Claes <toon@iotcl.com> writes:
Show 38 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>> This series is in response to an email thread [1] around the usage of
>> '.clang-format' and its effectiveness.
>>
>> The goal of the series is to improve the usage of 'clang-format' in the
>> repository. To do this we:
>> 1. Reduce the number of false positives. Majority of which is due to
>>    line-wrapping. We remove the 'ColumnLimit' from 'clang-format'. This
>>    removes the responsibility of line-wrapping from 'clang-format' and puts
>>    it into the hands of the user.
>> 2. Add a rule to 'meson' to run 'git clang-format' by running 'meson
>>    compile style'.
>> 3. Make the 'RemoveBracesLLVM' permanent by moving it to
>>    '.clang-format'.
>
> Thanks for working on this. While the changes are not huge, I appreciate
> them.
>
>> With this, running `git clang-format` for the last 25 commits in master,
>> seems to produce much less false positives.
>>
>> [snip]
>>
>>   diff --git a/pathspec.h b/pathspec.h
>>   index 5e3a6f1fe7..601b9ca201 100644
>>   --- a/pathspec.h
>>   +++ b/pathspec.h
>>   @@ -80,7 +80,7 @@ struct pathspec {
>>     * For git diff --no-index, indicate that we are operating without
>>     * a repository or index.
>>     */
>>   -#define PATHSPEC_NO_REPOSITORY (1<<7)
>>   +#define PATHSPEC_NO_REPOSITORY (1 << 7)
>
> I'm surprised, but I couldn't find a setting to change this...
>
>

I think spacing around binary operators is intrinsic and not an option [1]. But I'm not sure...

[1]: https://github.com/llvm/llvm-project/issues/19412
> --
> Cheers,
> Toon
Previous: Toon ClaesNext: Junio C Hamano
Message 31 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.