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

Re: [RFC PATCH 2/4] .clang-format: Add a BitFieldColonSpacing=None rule

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 12, 2022, 06:56 UTC
Message-ID
<220712.86czea6cg4.gmgdl@evledraar.gmail.com>
In-Reply-To
<YsynY24oV47q7YxU@tapette.crustytoothpaste.net>
On Mon, Jul 11 2022, brian m. carlson wrote:
Show 22 quoted lines
> [[PGP Signed Part:Undecided]]
> On 2022-07-11 at 11:37:26, Ævar Arnfjörð Bjarmason wrote:
>> Formatting bitfield as "unsigned foo:1" is the usual style in this
>> project, not "unsigned foo : 1", which clang-format will use by
>> default.
>> 
>> Before & after this change running "make style-all-diff-apply" will
>> yield:
>> 
>> 	582 files changed, 32029 insertions(+), 29794 deletions(-)
>> 	579 files changed, 32065 insertions(+), 29818 deletions(-)
>> 
>> However this highlights a major limitation in this approach, because
>> clang-format v12 or newer is required for this rule, but that version
>> was only released in April 2021.
>
> This isn't supported on Debian stable, which has clang 11.  I think we
> should expect that to be a viable development target here, and I know
> it's what some Git developers actually use.
>
> I think for now we should drop this patch, and we can reconsider it in
> the future.

That makes sense, but the unanswered question is still how we should relate this to your proposal of standardizing on clang-format.

I.e. this & maybe AlignArrayOfStructures (and probably some other things) are probably things we'd like to enable to closely match the style we have now (in the case of that setting, because we've converted the rest to designated initializers).

So we'd be left with one of:
 
 1. Just formatting according to the style an older version supports,
    even if it's not the preferred one.
 2. Require the newer version, after all you don't *need* to use
    clang-format, it's OK that we can run it somewhere...
 3. Fix some things now, maintain some whitelist of exceptions, and work
    towards parity (possibly with running a newer clang-format e.g. in
    CI).
 4. Something else...?
Previous: Junio C HamanoNext: Tuomas Ahola
Message 13 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.