| From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
|---|---|
| To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | run pgindent in CI |
| Date: | 2026-09-22 07:10:23 |
| Message-ID: | c344c048-cd65-4440-a00f-61b2c9062351@eisentraut.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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 | Content-Type | Size |
|---|---|---|
| 0001-XXX-misformatting-for-testing.patch | text/plain | 2.1 KB |
| 0002-Add-missing-exclude_file_patterns.patch | text/plain | 3.9 KB |
| 0003-Add-advisory-pgindent-check-to-CompilerWarnings-CI-j.patch | text/plain | 4.1 KB |
| ci-pgindent-check-screenshot.jpg | image/jpeg | 229.4 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | ChenhuiMo | 2026-09-22 07:12:56 | Re: [PATCH] postgres_fdw: Fix cost estimation for semi join pushdown |
| Previous Message | Tatsuya Kawata | 2026-09-22 07:07:41 | Re: subquery pullup misses lateral refs in join alias Vars |