Обсуждение: cfbot run pgindent?

Поиск
Список
Период
Сортировка

cfbot run pgindent?

От
Robbie Harwood
Дата:
Hi friends,

First, I've found cfbot really useful as tool for improving code
correctness.  So thanks for that.

Second, since the project does have a defined style checker, do you
think it would be possible to run it as part of cfbot and report errors?

Thanks,
--Robbie

Вложения

Re: cfbot run pgindent?

От
Peter Eisentraut
Дата:
On 18/12/2018 19:50, Robbie Harwood wrote:
> Second, since the project does have a defined style checker, do you
> think it would be possible to run it as part of cfbot and report errors?

pgindent is a code formatter, not a style checker.  Using it to check
whether just the newly added code is correctly formatted would probably
require that all existing code is correctly formatted at all times,
which isn't the case.

What cfbot could do is spit out a diff at the end between the current
code and the pgindent'ed version.  That might be useful in some cases.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: cfbot run pgindent?

От
Michael Paquier
Дата:
On Tue, Dec 18, 2018 at 10:08:33PM +0100, Peter Eisentraut wrote:
> What cfbot could do is spit out a diff at the end between the current
> code and the pgindent'ed version.  That might be useful in some cases.

Yes, that part would be useful.  Another thing is that some structures
need to be added to typedefs.list, which can also create noise diffs in
some patches.
--
Michael

Вложения

Re: cfbot run pgindent?

От
Thomas Munro
Дата:
On Wed, Dec 19, 2018 at 8:08 AM Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> On 18/12/2018 19:50, Robbie Harwood wrote:
> > Second, since the project does have a defined style checker, do you
> > think it would be possible to run it as part of cfbot and report errors?
>
> pgindent is a code formatter, not a style checker.  Using it to check
> whether just the newly added code is correctly formatted would probably
> require that all existing code is correctly formatted at all times,
> which isn't the case.
>
> What cfbot could do is spit out a diff at the end between the current
> code and the pgindent'ed version.  That might be useful in some cases.

pgindent has the problem of that typename list that is maintained by
mysterious manual means, so it might be noisy.

I think that in general any extra checks (for example perl scripts
that check that nodes have all the right boilerplate, read/write
functions etc, wait points have names and documentation, ... etc as
discussed a while back) might as well be in-tree and runnable from the
makefile so that everyone can run them directly if they want, and then
cfbot could too.

-- 
Thomas Munro
http://www.enterprisedb.com