Re: Add trim_trailing_whitespace to editorconfig file

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: 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>
Subject: Re: Add trim_trailing_whitespace to editorconfig file
Date: 2024-04-04 15:28:25
Message-ID: CAGECzQRw7Uq26D7mOOAEEgKW1fiWBC66x_f8LoCx1dSqk_fv7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 4 Apr 2024 at 17:23, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
> git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
>
> That's what I was hoping for for editorconfig-check, but as I said, the
> experience wasn't good.

Ah, I wasn't able to find that git incantation. I definitely think it
would be good if there was an official cli tool like that for
editorconfig, but the Javascript one was the closest I could find. The
Go one I haven't tried.

On Thu, 4 Apr 2024 at 17:23, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> On 04.04.24 16:58, Jelte Fennema-Nio wrote:
> > On Thu, 4 Apr 2024 at 15:25, Peter Eisentraut<peter(at)eisentraut(dot)org> wrote:
> >> Everybody has git. Everybody who edits .gitattributes can use git to
> >> check what they did.
> > What CLI command do you use to fix/ gitattributes on all existing
> > files? Afaict there's no command to actually remove the trailing
> > whitespace that git add complains about. If you don't have such a
> > command, then afaict updating gitattributes is also essentially
> > blind-updating.
>
> I don't have a command to fix files automatically, but I have a command
> to check them:
>
> git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
>
> That's what I was hoping for for editorconfig-check, but as I said, the
> experience wasn't good.
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2024-04-04 15:37:40 Re: WIP Incremental JSON Parser
Previous Message Peter Eisentraut 2024-04-04 15:23:28 Re: Add trim_trailing_whitespace to editorconfig file