Re: Add trim_trailing_whitespace to editorconfig file - Mailing list pgsql-hackers

From Jelte Fennema-Nio
Subject Re: Add trim_trailing_whitespace to editorconfig file
Date
Msg-id CAGECzQR7RVq7tyLGYToBDt2cYCn2A_zPLxNDGBFH-dgaGLxNww@mail.gmail.com
Whole thread Raw
In response to Re: Add trim_trailing_whitespace to editorconfig file  (Peter Eisentraut <peter@eisentraut.org>)
Responses Re: Add trim_trailing_whitespace to editorconfig file
List pgsql-hackers
On Fri, 16 Feb 2024 at 11:45, Peter Eisentraut <peter@eisentraut.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

pgsql-hackers by date:

Previous
From: Nazir Bilal Yavuz
Date:
Subject: Use streaming read API in ANALYZE
Next
From: Tom Lane
Date:
Subject: Re: numeric_big in make check?