From: | Daniel Gustafsson <daniel(at)yesql(dot)se> |
---|---|
To: | Florents Tselai <florents(dot)tselai(at)gmail(dot)com> |
Cc: | Jelte Fennema-Nio <me(at)jeltef(dot)nl>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com> |
Subject: | Re: CI: Add task that runs pgindent |
Date: | 2025-10-21 13:46:23 |
Message-ID: | 675F571B-34BE-445B-B250-7546C9CB79D1@yesql.se |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> On 21 Oct 2025, at 15:39, Florents Tselai <florents(dot)tselai(at)gmail(dot)com> wrote:
>
>> On 21 Oct 2025, at 3:19 PM, Jelte Fennema-Nio <me(at)jeltef(dot)nl> wrote:
>>
>> At PGConf.dev 2025 one thing that came up in the "Scaling PostgreSQL
>> Development" unconference session is that new hackers don't know all the
>> details of our development flow by heart yet. Of course it's documented
>> on the wiki, but even if they find the relevant wiki pages they often
>> still miss/forget things. One of the things they often forget is
>> formatting their code. The consensus at that session was that it was
>> probably worth adding a CI task for this to nudge newcomers to indent
>> their code.
>>
>> We're not too worried about this new requirement scaring away newcomers,
>> since autoformatting has become fairly commonplace in open source
>> development. Also committers can of course still choose to format the
>> patch themselves before committing if the formatting is failing.
>>
>> This might also help reduce the number of unindented commits that
>> committers push, which require a follow up "fix indent" commit to make
>> the koel buildfarm animal happy again.
>> <v1-0001-CI-Add-task-that-runs-pgindent.patch>
>
> I wonder if adding a pre-commit Git hook (for example under .git/hooks/pre-commit) might be an equally or even more suitable way to handle this?
>
> That wouldn’t preclude having a CI task as well, of course.
> The hook would mainly help contributors catch formatting issues locally, while the CI task would serve as a failsafe for committers.
One common argument against enforcing proper indentation in submissions is that
it adds a barrier to entry, it's the committers job to ensure the code is
according to project policy before committing, flagging patches as red in CI
doesn't really help as all committers will do the extra step regardless.
Conforming to indentation rules in v1 of a patchset isn't the most interesting
aspect of a submission, especially for WIP and POC style patches.
--
Daniel Gustafsson
From | Date | Subject | |
---|---|---|---|
Next Message | Dimitrios Apostolou | 2025-10-21 13:57:31 | Re: [PATCH v4] parallel pg_restore: avoid disk seeks when jumping short distance forward |
Previous Message | Florents Tselai | 2025-10-21 13:39:43 | Re: CI: Add task that runs pgindent |