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

Поиск
Список
Период
Сортировка
От Jelte Fennema-Nio
Тема Add "format" target to make and ninja to run pgindent and pgperltidy
Дата
Msg-id DFCDD5H4J7VX.3GJKRBBDCKQ86@jeltef.nl
обсуждение исходный текст
Ответы Re: Add "format" target to make and ninja to run pgindent and pgperltidy
Список pgsql-hackers
This tries to make running formatting a lot easier for committers, but
primarily for new contributors. You can not format the files by simply
running one of the folowing:

make format
ninja -C build format

My primary goal is to introduce Python formatting too (using ruff), and
integrate that in a similar manner. Right now we don't have many Python
files, but hopefully the pytest patch gets merged soonish and then we'll
get more and more Python files. So I'd like to get autoformatting out of
the gate.

But even without that, these rules should make it simpler to run the
current formatters:

Running pgindent is still not trivial for new users. You need to add our
pg_bsd_indent to PATH. And if you use meson to build you have to manually
specify src/ and contrib/ instead of ./ because otherwise pgindent will
try to format files in the build directory.

Running pgperltidy is even more complicated because you need to install
a specific version of perltidy. Recently we started erroring when that
version was not the one we expect.

Вложения

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