All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	rsbecker@nexbridge.com
Subject: Re: [RFC PATCH 2/4] .clang-format: Add a BitFieldColonSpacing=None rule
Date: Tue, 12 Jul 2022 08:56:46 +0200	[thread overview]
Message-ID: <220712.86czea6cg4.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <YsynY24oV47q7YxU@tapette.crustytoothpaste.net>


On Mon, Jul 11 2022, brian m. carlson wrote:

> [[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...?

  parent reply	other threads:[~2022-07-12  7:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-10 21:50 Automatic code formatting brian m. carlson
2022-07-10 22:08 ` Junio C Hamano
2022-07-10 22:13 ` rsbecker
2022-07-11  0:58   ` brian m. carlson
2022-07-11  1:28     ` rsbecker
2022-07-11 16:53       ` Elijah Newren
2022-07-11 20:15         ` Ævar Arnfjörð Bjarmason
2022-07-11 21:19           ` Elijah Newren
2022-07-11 11:37 ` [RFC PATCH 0/4] make headway towards a clean "clang-format" Ævar Arnfjörð Bjarmason
2022-07-11 11:37   ` [RFC PATCH 1/4] Makefile: add a style-all targets for .clang-format testing Ævar Arnfjörð Bjarmason
2022-07-11 11:37   ` [RFC PATCH 2/4] .clang-format: Add a BitFieldColonSpacing=None rule Ævar Arnfjörð Bjarmason
2022-07-11 22:42     ` brian m. carlson
2022-07-11 22:52       ` Junio C Hamano
2022-07-12  6:56       ` Ævar Arnfjörð Bjarmason [this message]
2022-07-11 11:37   ` [RFC PATCH 3/4] .clang-format: do not enforce a ColumnLimit Ævar Arnfjörð Bjarmason
2022-07-11 21:37     ` Junio C Hamano
2022-07-12  7:03       ` Ævar Arnfjörð Bjarmason
2022-07-11 22:39     ` brian m. carlson
2022-07-11 22:46       ` Junio C Hamano
2022-07-11 23:05         ` Eric Sunshine
2022-07-11 23:30           ` Junio C Hamano
2022-07-11 11:37   ` [RFC PATCH 4/4] .clang-format: don't indent "goto" labels Ævar Arnfjörð Bjarmason
2022-07-11 21:04     ` Junio C Hamano
2022-07-12  6:55       ` Ævar Arnfjörð Bjarmason
2022-07-11 13:17 ` Automatic code formatting Phillip Wood
2022-07-11 13:21   ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=220712.86czea6cg4.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rsbecker@nexbridge.com \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.