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-02-19 15:21:27
Message-ID: CAGECzQR7RVq7tyLGYToBDt2cYCn2A_zPLxNDGBFH-dgaGLxNww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 16 Feb 2024 at 11:45, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
> I have committed that one.

Thanks :)

> v3-0002-Require-final-newline-in-.po-files.patch
>
> The .po files are imported from elsewhere, so I'm not sure this is going
> to have the desired effect. Perhaps it's worth cleaning up, but it
> would require more steps.

Okay, yeah that would need to be changed at the source then. Removed
this change from the newly attached patchset, as well as updating
editorconfig to have "insert_final_newline = unset" for .po files.

> v3-0003-Bring-editorconfig-in-line-with-gitattributes.patch
>
> I question whether we need to add rules to .editorconfig about files
> that are generated or imported from elsewhere, since those are not meant
> to be edited.

I agree that it's not strictly necessary to have .editorconfig match
.gitattributes for files that are not meant to be edited by hand. But
I don't really see a huge downside either, apart from having a few
extra lines it .editorconfig. And adding these lines does have a few
benefits:
1. It makes it easy to ensure that .editorconfig and .gitattributes stay in sync
2. If someone opens a file that they are not supposed to edit by hand,
and then saves it. Then no changes are made. As opposed to suddenly
making some whitespace changes

Attached is a new patchset with the first commit split in three
separate commits, which configure:
1. Files meant to be edited by hand)
2. Output test files (maybe edited by hand)
3. Imported/autogenerated files

The first one is definitely the most useful to me personally.

Attachment Content-Type Size
v4-0002-Include-test-output-files-in-.editorconfig.patch text/x-patch 1017 bytes
v4-0001-Handle-blank-at-eof-blank-at-eol-in-.editorconfig.patch text/x-patch 1.4 KB
v4-0004-Add-note-about-keeping-.editorconfig-and-.gitattr.patch text/x-patch 1.1 KB
v4-0003-Bring-.editorconfig-fully-in-sync-with-.gitattrib.patch text/x-patch 2.1 KB
v4-0005-Add-indent-information-about-gitattributes-to-edi.patch text/x-patch 796 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-02-19 15:35:25 Re: numeric_big in make check?
Previous Message Nazir Bilal Yavuz 2024-02-19 15:13:23 Use streaming read API in ANALYZE