Re: Add "format" target to make and ninja to run pgindent and pgperltidy

Поиск
Список
Период
Сортировка
От Jelte Fennema-Nio
Тема Re: Add "format" target to make and ninja to run pgindent and pgperltidy
Дата
Msg-id DHJCUQA4HF9H.10EN25MHG0YRW@jeltef.nl
обсуждение исходный текст
Ответ на Re: Add "format" target to make and ninja to run pgindent and pgperltidy  (Peter Eisentraut <peter@eisentraut.org>)
Список pgsql-hackers
On Fri Mar 27, 2026 at 2:32 PM CET, Peter Eisentraut wrote:
> I have committed these two.

Thanks!

> v3-0003-pgindent-Use-git-ls-files-to-discover-files.patch
>
> This looks structurally correct, but I wonder whether this:
>
>      my @git_files = `git ls-files -- @dirs`;
>
> could be written in a way that is more robust against funny file names.
> (pgindent is also used against trees that are not stock PostgreSQL.)

I have changed it to use open so the args are not string interpolated
and -z so the resulting files are null-separated instead of
newline-separated. Is this the kind of thing you had in mind?

> v3-0004-pgindent-Default-to-indenting-the-current-directo.patch
>
> Note that other tools also share this behavior with pgindent:
>
> src/tools/pgindent/pgperltidy
> src/tools/perlcheck/pgperlcritic
> src/tools/perlcheck/pgperlsyncheck
>
> If we change one, we should change all.

I think that's fair, but because the other tools don't use git ls-files
I don't wanna do that in this commit.

Instead I updated the later commits to not just integrate pgperltidy
into pgindent, but create a new pgcheck tool that combines all of these
tools (the old scripts are kept as tiny wrappers). So after committing
all these tools behave the same way, not just in wheter no arguments
means "current directory" but also in all the flags they accept.

Вложения

В списке pgsql-hackers по дате отправления: