On 24.09.26 17:15, Peter Eisentraut wrote:
On 23.09.26 16:35, Tom Lane wrote:
If we want to change that, then making CI bitch about non-ignored
files would be a good step, but it's incomplete unless the buildfarm
implementation enforces indent cleanliness the same way. IOW, what
I'm complaining about here is that what you want to do doesn't match
what koel does. They need to match.
I have launched two new threads to prepare for this:
pgindent to ignore build directories
(https://www.postgresql.org/message-id/
fc77b35a-34c4-4229-82f1-8cf0ce67f276%40eisentraut.org)
convert CI CompilerWarnings job to meson
(https://www.postgresql.org/message-id/e52e2c29-4834-4c64-a200-
eddcba38fb4d%40eisentraut.org)
When those are done, it will be possible to reproduce the koel
environment on CI, and we can come back to this.
The above have been done, so here we are back on this.
I have adapted the workflow code to use meson now. I have also dropped
the github step summary display; the output (pgindent diff etc.) is now
just inline in the job logs. It's all pretty simple and straightforward
now.
I've kept the exclude_file_patterns patch here. I think we should still
apply this. As long as that file exists, we should keep it up to date,
and the patch was already written.
From 27c86346e543accce0eb3019ea6373f96d99d6b5 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Tue, 22 Sep 2026 07:55:39 +0200
Subject: [PATCH v2 1/3] XXX misformatting for testing
---
src/backend/libpq/README.SSL | 3 ++-
src/bin/psql/startup.c | 7 ++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/backend/libpq/README.SSL b/src/backend/libpq/README.SSL
index d84a434a6ee..fabcb92b5a0 100644
--- a/src/backend/libpq/README.SSL
+++ b/src/backend/libpq/README.SSL
@@ -75,8 +75,9 @@ extent possible, to minimize the risk of impersonations.
Another benefit of EDH is that it allows the backend and clients to
use DSA keys. DSA keys can only provide digital signatures, not
encryption, and are often acceptable in jurisdictions where RSA keys
-are unacceptable.
+are unacceptable.
The downside to EDH is that it makes it impossible to use ssldump(1)
if there's a problem establishing an SSL session. In this case you'll
need to temporarily disable EDH (see initialize_dh()).
+
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index bb33c7c14d7..65b345ebf58 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -102,7 +102,7 @@ log_locus_callback(const char **filename, uint64 *lineno)
if (pset.inputfile)
{
*filename = pset.inputfile;
- *lineno = pset.lineno;
+ *lineno = pset.lineno;
}
else
{
@@ -192,7 +192,7 @@ main(int argc, char *argv[])
/* Create variables showing psql version number */
SetVariable(pset.vars, "VERSION", PG_VERSION_STR);
- SetVariable(pset.vars, "VERSION_NAME", PG_VERSION);
+ SetVariable(pset.vars, "VERSION_NAME", PG_VERSION);
SetVariable(pset.vars, "VERSION_NUM", CppAsString2(PG_VERSION_NUM));
/* Initialize variables for last error */
@@ -1136,7 +1136,7 @@ prompt2_hook(const char *newval)
static bool
prompt3_hook(const char *newval)
{
- pset.prompt3 = newval ? newval : "";
+ pset.prompt3 = newval ? newval : "";
return true;
}
@@ -1294,3 +1294,4 @@ EstablishVariableSpace(void)
watch_interval_substitute_hook,
watch_interval_hook);
}
+
base-commit: 8e997cb8c9ecc27e55e38bb42f1cefd5ef74c9a0
--
2.56.0
From 81a4b857e464d6fd07957a1adf315b9747228db5 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Wed, 4 Nov 2026 23:48:22 +0100
Subject: [PATCH v2 3/3] Add advisory pgindent check to CompilerWarnings CI job
Run pgindent --check --diff over the whole tree at the end of the
CompilerWarnings job, reusing the configured tree left behind by the
headerscheck step to build pg_bsd_indent.
Also run a git whitespace check.
These checks are advisory only: Violations produce a warning
annotation but do not fail the workflow.
Discussion:
https://www.postgresql.org/message-id/flat/DDNZTVO6E6GF.17IEQGZ1GC9D7%40jeltef.nl
Discussion:
https://www.postgresql.org/message-id/flat/c344c048-cd65-4440-a00f-61b2c9062351%40eisentraut.org
---
.github/workflows/pg-ci.yml | 53 ++++++++++++++++++++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/pg-ci.yml b/.github/workflows/pg-ci.yml
index e8eb49b5f15..4d4cdd024c0 100644
--- a/.github/workflows/pg-ci.yml
+++ b/.github/workflows/pg-ci.yml
@@ -1150,7 +1150,7 @@ jobs:
# Test that code can be built with both gcc and clang without warnings,
# with various combinations of cassert/dtrace flags. Trace probes have
# a history of getting accidentally broken; the matrix is there to
- # catch that.
+ # catch that. Also runs some other source-level checks.
compiler-warnings:
name: CompilerWarnings
needs: [setup, sanity-check]
@@ -1284,6 +1284,57 @@ jobs:
ninja -C build --quiet -j${{env.BUILD_JOBS}} -k 0 \
headerscheck cpluspluscheck
+ ###
+ # Verify that the tree is pgindent-clean
+ #
+ # Advisory only: reports violations as a warning annotation and in the
+ # step summary, but does not fail the workflow.
+ #
+ # Relies on the preceding headerscheck step having configured the tree,
+ # which is needed to build pg_bsd_indent.
+ ###
+ - name: pgindent check
+ if: ${{ !cancelled() }}
+ run: |
+ echo "::group::build pg_bsd_indent"
+ ninja -C build src/tools/pg_bsd_indent/pg_bsd_indent
+ echo "::endgroup::"
+
+ rc=0
+ src/tools/pgindent/pgindent
--indent=build/src/tools/pg_bsd_indent/pg_bsd_indent --check --diff . || rc=$?
+
+ if [ "$rc" -eq 2 ]; then
+ echo "::warning title=pgindent::Tree is not pgindent-clean; see
CompilerWarnings job."
+ elif [ "$rc" -ne 0 ]; then
+ # pgindent itself failed; that is a real error
+ exit "$rc"
+ fi
+
+ ###
+ # Verify that the tree is git whitespace clean
+ #
+ # Advisory only: reports violations as a warning annotation and in the
+ # step summary, but does not fail the workflow.
+ ###
+ - name: git whitespace check
+ if: ${{ !cancelled() }}
+ run: |
+ # This job runs in a container, where the checkout is owned
+ # by a different user than the one running the steps, so git
+ # would otherwise refuse to operate on it ("dubious
+ # ownership").
+ git config --global --add safe.directory "$GITHUB_WORKSPACE"
+
+ rc=0
+ git diff-tree --check `git hash-object -t tree /dev/null` HEAD ||
rc=$?
+
+ if [ "$rc" -eq 2 ]; then
+ echo "::warning title=git::Tree is not git whitespace-clean; see
CompilerWarnings job."
+ elif [ "$rc" -ne 0 ]; then
+ # git itself failed; that is a real error
+ exit "$rc"
+ fi
+
- *ccache_decide_save_step
- *ccache_save_step
- *upload_logs_step
--
2.56.0
From 15cc122ae33232a99ced11ccaa00c5ef8035b030 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Tue, 22 Sep 2026 07:55:39 +0200
Subject: [PATCH v2 2/3] Add missing exclude_file_patterns
Many generated files were not listed. Some files had been moved but
not updated here.
Apparently, not many people run pgindent in a configuration that is
affected by this omission. Either the generated files are built
out-of-tree, or they would get reindented but then ignored via
gitignore. But if you run pgindent --check --diff, then they will get
indented and differences will show up.
Discussion:
https://www.postgresql.org/message-id/flat/c344c048-cd65-4440-a00f-61b2c9062351%40eisentraut.org
---
src/tools/pgindent/exclude_file_patterns | 60 ++++++++++++++++++++++--
1 file changed, 56 insertions(+), 4 deletions(-)
diff --git a/src/tools/pgindent/exclude_file_patterns
b/src/tools/pgindent/exclude_file_patterns
index 4976a373f9e..cc7cee27e4c 100644
--- a/src/tools/pgindent/exclude_file_patterns
+++ b/src/tools/pgindent/exclude_file_patterns
@@ -9,22 +9,73 @@ src/include/jit/llvmjit\.h$
src/include/jit/SectionMemoryManager\.h$
#
# These are generated files with incomplete code fragments that
-# confuse pgindent.
+# confuse pgindent. (make and meson generate these in different
+# directories.)
src/backend/nodes/\w+\.funcs\.c$
src/backend/nodes/\w+\.switch\.c$
+src/include/nodes/\w+\.funcs\.c$
+src/include/nodes/\w+\.switch\.c$
#
# These are generated by generate-wait_event_types.pl, whose format
# looks worse with pgindent.
-src/backend/utils/activity/pgstat_wait_event\.c$
-src/backend/utils/activity/wait_event_funcs_data\.c$
-src/backend/utils/activity/wait_event_types\.h$
+src/backend/utils/pgstat_wait_event\.c$
+src/backend/utils/wait_event_funcs_data\.c$
+src/backend/utils/wait_event_types\.h$
+src/include/utils/pgstat_wait_event\.c$
+src/include/utils/wait_event_funcs_data\.c$
+src/include/utils/wait_event_types\.h$
#
# This confuses pgindent, and it's a derived file anyway.
src/backend/utils/fmgrtab\.c$
+src/include/utils/fmgrtab\.c$
#
# pgindent might mangle entries in this that match typedef names.
# Since it's a derived file anyway, just exclude it.
src/backend/utils/fmgrprotos\.h$
+src/include/utils/fmgrprotos\.h$
+#
+# Other generated files.
+src/backend/nodes/nodetags\.h$
+src/include/nodes/nodetags\.h$
+src/backend/storage/lmgr/lwlocknames\.h$
+src/include/storage/lwlocknames\.h$
+src/backend/utils/errcodes\.h$
+src/include/utils/errcodes\.h$
+src/backend/utils/fmgroids\.h$
+src/include/utils/fmgroids\.h$
+src/backend/utils/guc_tables\.inc\.c$
+src/include/utils/guc_tables\.inc\.c$
+src/include/catalog/pg_\w+_d\.h$
+src/include/catalog/schemapg\.h$
+src/include/catalog/syscache_ids\.h$
+src/include/catalog/syscache_info\.h$
+src/include/catalog/system_fk_info\.h$
+src/include/generated-[\w-]+-stamp\.h$
+contrib/fuzzystrmatch/daitch_mokotoff\.h$
+src/bin/psql/sql_help\.[ch]$
+src/bin/psql/tab-complete\.c$
+src/common/unicode/norm_test_table\.h$
+src/interfaces/ecpg/include/ecpg_config\.h$
+src/pl/plperl/perlchunks\.h$
+src/pl/plperl/plperl_opmask\.h$
+src/pl/plpgsql/src/plerrcodes\.h$
+src/pl/plpython/spiexceptions\.h$
+src/pl/tcl/pltclerrcodes\.h$
+src/port/pg_config_paths\.h$
+src/include/pg_config_paths\.h$
+#
+# The build creates these as symlinks to (or copies of) files that live
+# elsewhere in the tree, where they are indented in their own right.
+src/backend/port/pg_sema\.c$
+src/backend/port/pg_shmem\.c$
+src/bin/initdb/localtime\.c$
+src/bin/pg_rewind/xlogreader\.c$
+src/bin/pg_waldump/xlogreader\.c$
+src/bin/pg_waldump/xlogstats\.c$
+# ... the rmgrdesc files, except pg_waldump's own rmgrdesc.c
+src/bin/pg_waldump/(?!rmgrdesc\.c$)\w*desc\w*\.c$
+src/include/pg_config_os\.h$
+src/interfaces/ecpg/preproc/typename\.c$
#
# kwlist_d files are made by gen_keywordlist.pl. While we could insist that
# they match pgindent style, they'd look worse not better, so exclude them.
@@ -49,6 +100,7 @@ src/interfaces/ecpg/test/.*/
# so we shouldn't expect them to conform to our style.
# (Some versions of dtrace build probes.h files that confuse pgindent, too.)
src/backend/utils/probes\.h$
+src/include/utils/probes\.h$
src/include/pg_config\.h$
src/pl/plperl/ppport\.h$
src/pl/plperl/SPI\.c$
--
2.56.0