public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Thomas Rodgers <trodgers@redhat.com>
Cc: Dimitrij Mijoski <dmjpp@hotmail.com>,
	"libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>
Subject: Re: Add clang-format for libstdc++
Date: Tue, 7 Feb 2023 21:19:44 +0000	[thread overview]
Message-ID: <CACb0b4k7yzP-19cwM9XB0Riui4Lga1phimZyHNKqXbZB4c9qSQ@mail.gmail.com> (raw)
In-Reply-To: <CAMmuTO8cmJzVRb=60qH0LOBZbFFhLhpzX0XpZF_ChOptn5izMg@mail.gmail.com>

On Tue, 7 Feb 2023 at 21:02, Thomas Rodgers via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> I am potentially interested in this, with an additional twist -
>
> Is it possible to get clang-format to enforce the libstdc++ uglification
> rules (probably requires a clang-format plugin though)?
>
> The concrete example I am thinking of here is when we adopt something like
> the PSTL. It was a substantial manual effort to do the uglification on that
> code in the first place, and despite multiple reviews by myself and
> jwakely, we still managed to miss some identifiers. To complicate matters,
> the upstream also makes ongoing changes while making a best effort to
> preserve the uglifcation. They also miss some uglfications. The main
> contributors in this case are shipping the PSTL as part of oneTBB and so
> don't have the same requirements to 'get it right' as libstdc++, so this
> often goes undetected.
>
> I am looking to rebase libstdc++'s PSTL in the near future so I'd be
> willing to try something based on clang-format, if it existed, for this
> particular purpose (I'm less interested in enforcing the indentation rules
> in this case, as I want to preserve the upstream's formatting).
>
> I also think it is potentially useful to have both the uglification and
> indentation combined. The case I'm thinking of is something like the <simd>
> contribution (or ranges) which are similarly large and need to get the
> uglification checks and in those cases, the correct libstdc++ formatting as
> part of the adoption process.


The best we have for this right now is the 17_intro/names.cc test.
Names that are used in the PSTL (e.g. "binary_op", "exec", etc.)
should be added to that file, so that if they appear without the "__"
prefix we get test failures.


  reply	other threads:[~2023-02-07 21:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 20:38 Dimitrij Mijoski
2023-02-07 21:01 ` Thomas Rodgers
2023-02-07 21:19   ` Jonathan Wakely [this message]
2023-02-07 21:24     ` Thomas Rodgers
2023-02-10 22:05   ` Stephan Bergmann
2023-02-10 23:02     ` Jonathan Wakely
2023-02-13 10:18       ` Stephan Bergmann
2023-02-07 21:17 ` Jonathan Wakely
2023-02-08 20:04   ` Björn Schäpers

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=CACb0b4k7yzP-19cwM9XB0Riui4Lga1phimZyHNKqXbZB4c9qSQ@mail.gmail.com \
    --to=jwakely@redhat.com \
    --cc=dmjpp@hotmail.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=trodgers@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).