Re: Add trim_trailing_whitespace to editorconfig file

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
Subject: Re: Add trim_trailing_whitespace to editorconfig file
Date: 2024-08-07 19:09:51
Message-ID: 471c77b2-872b-47e6-ba8a-96d03f22c0ee@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2024-08-07 We 1:09 PM, Jelte Fennema-Nio wrote:
> On Tue, 9 Apr 2024 at 12:42, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl> wrote:
>> Okay, I spent the time to add a script to generate the editorconfig
>> based on .gitattributes after all. So attached is a patch that adds
>> that.
> I would love to see this patch merged (or at least some feedback on
> the latest version). I think it's pretty trivial and really low risk
> of breaking anyone's workflow, and it would *significantly* improve my
> own workflow.
>
> Matthias mentioned on Discord that our vendored in pg_bsd_indent uses
> a tabwidth of 8 and that was showing up ugly in his editor. I updated
> the patch to include a fix for that too.

You're not meant to use our pg_bsd_indent on its own without the
appropriate flags, namely (from src/tools/pgindent/pgindent):

"-bad -bap -bbb -bc -bl -cli1 -cp33 -cdb -nce -d0 -di12 -nfc1 -i4 -l79
-lp -lpl -nip -npro -sac -tpg -ts4"

If that's inconvenient you can create a .indent.pro with the settings.

Also, why are you proposing to undet indent-style for .pl and .pm files?
That's not in accordance with our perltidy settings
(src/tools/pgindent/perltidyrc), unless I'm misunderstanding.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2024-08-07 19:39:49 Re: Add LSN <-> time conversion functionality
Previous Message Dean Rasheed 2024-08-07 18:39:38 Re: Adding OLD/NEW support to RETURNING