Re: [PATCH] pgindent truncates last line of files missing a trailing newline

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] pgindent truncates last line of files missing a trailing newline
Date: 2026-03-27 19:28:16
Message-ID: 1352724.1774639696@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On 2026-03-26 Th 12:29 PM, Tom Lane wrote:
>> I'm not sure I want to expend the brain cells to figure out whether
>> this is a correct/complete patch. If pg_bsd_indent were less of an
>> undercommented spaghetti-code nightmare, maybe fixing it here would
>> be reasonable. But as things stand, why don't we just fix this in
>> the perl wrapper, as attached?

> Well, I thought we were trying to reduce the fixups we did in pgindent.

Yeah, other things being equal I too would prefer to fix it within
pg_bsd_indent. But other things are not equal: the complexity
and reviewability of the proposed v2 patch are not comparable to
a one-liner fix in the wrapper.

> However, I take your point about the ugly nature of the pg_bsd_indent
> code. So I'm ok with this fix, which is quite straightforward.

I'll make it so.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2026-03-27 19:31:04 Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Previous Message Andrew Dunstan 2026-03-27 19:24:49 Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part