Re: run pgindent on a regular basis / scripted manner

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: run pgindent on a regular basis / scripted manner
Дата
Msg-id 600db31e-d006-f8f2-7443-c1c7d5aae0cd@dunslane.net
обсуждение исходный текст
Ответ на Re: run pgindent on a regular basis / scripted manner  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers


On 2023-04-22 Sa 16:15, Tom Lane wrote:
Noah Misch <noah@leadboat.com> writes:
- skip if the break-glass "pgindent: no" appears in a commit message
There are two things that bother me about putting this functionality
into a server hook, beyond the possible speed issue:

* The risk of failure.  I don't have a terribly difficult time imagining
situations where things get sufficiently wedged that the server accepts
*no* commits, not even ones fixing the problem.  An override such as
you suggest here could assuage that fear, perhaps.

* The lack of user-friendliness.  AFAIK, if a pre-receive hook fails
you learn little except that it failed.  This could be extremely
frustrating to debug, especially in a situation where your local
pgindent is giving you different results than the server gets.

The idea of a buildfarm animal failing if --show-diff isn't empty
is attractive to me mainly because it is far nicer from the
debuggability standpoint.

Maybe, after we get some amount of experience with trying to keep
things always indent-clean, we will decide that it's reliable enough
to enforce in a server hook.  I think going for that right away is
sheer folly though.
			


What I'll do for now is set up a buildfarm module that will log the differences but won't error out if there are any. At least that way we'll know better what we're dealing with.

I don't really like Noah's idea of having a pre-receive hook possibly spew thousands of diff lines to the terminal.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: run pgindent on a regular basis / scripted manner
Следующее
От: Tom Lane
Дата:
Сообщение: Re: run pgindent on a regular basis / scripted manner