Re: Adding a clang-format file

From: Ray Eldath <ray(dot)eldath(at)outlook(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Adding a clang-format file
Date: 2023-11-23 04:00:26
Message-ID: D53B4B66-21D1-4139-9530-DCB4A01591FE@outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Just wondering would you mind sharing your .clang-format file? I find
the attachment you pointed to is only a demo with a “…” line and it doesn’t
format PG code very well.

btw I’m also greatly in favor of this idea. clang-format is tightly integrated into
CLion and it’s very convenient. right now I’m using a CLion preset by Greenplum [1]
but it doesn’t handle struct fields and variables column alignment very well.

[1] https://groups.google.com/a/greenplum.org/g/gpdb-dev/c/rDYSYotssbE/m/7HgsWuj7AwAJ

> On Sep 28, 2022, at 08:43, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
>
> On Tue, Sep 27, 2022 at 5:35 AM Aleksander Alekseev
> <aleksander(at)timescale(dot)com> wrote:
>> Personally I don't have anything against the idea. TimescaleDB uses
>> clang-format to mimic pgindent and it works quite well. One problem
>> worth mentioning though is that the clang-format file is dependent on
>> the particular version of clang-format.
>
> I was hoping that something generic could work here. Something that we
> could provide that didn't claim to be authoritative, that has a
> reasonable degree of compatibility that allows most people to use the
> file without much fuss. Kind of like our .editorconfig file. That
> might not be a realistic goal, though, since the clang-format settings
> are all quite complicated.
>
> --
> Peter Geoghegan
>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bowen Shi 2023-11-23 04:05:34 Re: [PATCH] Add CHECK_FOR_INTERRUPTS in scram_SaltedPassword loop.
Previous Message Bowen Shi 2023-11-23 03:52:22 Re: [HACKERS] make async slave to wait for lsn to be replayed