Re: pgindent vs. pgperltidy command-line arguments

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgindent vs. pgperltidy command-line arguments
Date: 2023-05-25 13:20:32
Message-ID: 1471230.1685020832@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> Until PG15, calling pgindent without arguments would process the whole
> tree. Now you get
> No files to process at ./src/tools/pgindent/pgindent line 372.
> Is that intentional?

It was intentional, cf b16259b3c and the linked discussion.

> Also, pgperltidy accepts no arguments and always processes the whole
> tree. It would be nice if there were a way to process individual files
> or directories, like pgindent can.

+1, although I wonder if we shouldn't follow pgindent's new lead
and require some argument(s).

> Attached is a patch for this.
> (It seems that it works ok to pass regular files (not directories) to
> "find", but I'm not sure if it's portable.)

The POSIX spec for find(1) gives an example of applying find to
what they evidently intend to be a plain file:

if [ -n "$(find file1 -prune -newer file2)" ]; then
printf %s\\n "file1 is newer than file2"
fi

So while I don't see it written in so many words, I think you
can assume it's portable.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema 2023-05-25 13:23:40 Re: Adding SHOW CREATE TABLE
Previous Message Tom Lane 2023-05-25 13:09:45 Re: Why does pg_bsd_indent need to be installed?