Re: run pgindent on a regular basis / scripted manner - Mailing list pgsql-hackers

From Étienne BERSAC
Subject Re: run pgindent on a regular basis / scripted manner
Date
Msg-id 8331c9d408e3e4717c730fde069cec8edd1af356.camel@dalibo.com
Whole thread Raw
In response to Re: run pgindent on a regular basis / scripted manner  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: run pgindent on a regular basis / scripted manner
List pgsql-hackers
Hello,


> Yes, there's a lot to look out for, and you're a damn sight better at
> it
> than I am. But we should try to automate the things that can be
> automated, even if that leaves many tasks that can't be. I have three
> things in my pre-commit hook: a check for catalog updates, a check
> for
> new typedefs, and an indent check.

Could you share your configuration ? Could we provide more helper and
integration to help produce consistent code ?

For logfmt extension, I configured clang-formatd so that Emacs format
the buffer on save. Any editor running clangd will use this. This is
ease my mind about formatting. I need to investigate how to use
pgindent instead or at lease ensure clang-format produce same output as
pgindent.

https://gitlab.com/dalibo/logfmt/-/blob/0d808b368e649b23ac06ce2657354b67be398b21/.clang-format

Automate nitpicking in CI is good, but checking locally before sending
the patch will save way more round-trip.

Regards,
Étienne



pgsql-hackers by date:

Previous
From: Étienne BERSAC
Date:
Subject: Re: RFC: Logging plan of the running query
Next
From: Michael Paquier
Date:
Subject: Re: PATCH: Add REINDEX tag to event triggers