run pgindent in CI - Mailing list pgsql-hackers

From Peter Eisentraut
Subject run pgindent in CI
Date
Msg-id c344c048-cd65-4440-a00f-61b2c9062351@eisentraut.org
Whole thread
Responses Re: run pgindent in CI
Re: run pgindent in CI
Re: run pgindent in CI
List pgsql-hackers
Previously discussed in [0].  People seemed to generally like the idea 
of running pgindent in CI but didn't want the job to fail outright if 
there were violations.  My proposal here is to use a combination of 
GitHub Actions features [1] to create job annotations and step summaries 
to create some kind of warning output.  I have attached an example 
screenshot.

I also added a git whitespace check in the same way.  Additional 
formatting checks like pgperltidy, Python stuff, etc. could be added 
similarly.

(I imagine there could be some cfbot integration that represents these 
annotations in a non-threatening way, but I have not looked into that at 
all.)

One surprise from this is that this generates a massive pgindent diff 
against the current tree, because there are a bunch of entries missing 
or wrong in src/tools/pgindent/exclude_file_patterns.  I guess most 
people don't see this because these are mostly generated files, which 
would get reindented but then ignored via gitignore, but if you run 
pgindent --check --diff, then this will show up.

I don't exactly know how the buildfarm member koel gets away with this. 
The notes say "Runs pgindent --show-diff", but that is not an actual 
existing option.  One evident difference is that koel runs meson, but I 
have added this to the existing CompilerWarnings job and reused the tree 
from the headerscheck step, which uses autoconf.  Anyway, maybe this 
could be improved sometime to reduce variability, but for now I have 
just included a patch to update exclude_file_patterns as needed.

Thoughts?


[0]: 
https://www.postgresql.org/message-id/flat/DDNZTVO6E6GF.17IEQGZ1GC9D7%40jeltef.nl

[1]: 
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands
Attachment

pgsql-hackers by date:

Previous
From: Tatsuya Kawata
Date:
Subject: Re: subquery pullup misses lateral refs in join alias Vars
Next
From: "ChenhuiMo"
Date:
Subject: Re: [PATCH] postgres_fdw: Fix cost estimation for semi join pushdown