Re: run pgindent on a regular basis / scripted manner
Andres Freund <andres@anarazel.de>
Hi, On 2023-10-18 21:29:37 -0400, Tom Lane wrote: > Andres Freund <andres@anarazel.de> writes: > > It turns out that updating the in-tree typedefs.list would be very noisy. On > > my local linux system I get > > 1 file changed, 422 insertions(+), 1 deletion(-) > > On a mac mini I get > > 1 file changed, 351 insertions(+), 1 deletion(-) > > That seems like it needs a considerably closer look. What exactly > is getting added/deleted? Types from bison, openssl, libxml, libxslt, icu and libc, at least. If I enable LLVM, there are even more. (I think I figured out what's happening further down) > > We could possibly address that by updating the in-tree typedefs.list a bit > > more aggressively. Sure looks like the source systems are on the older side. > > Really? Per [1] we've currently got contributions from calliphoridae > which is Debian sid, crake which is Fedora 38, indri/sifaka which are > macOS Sonoma. Were you really expecting something newer, and if so what? It's quite odd, I see plenty more types than those. I can't really explain why they're not being picked up on those animals. E.g. for me bison generated files contain typedefs like typedef int_least8_t yytype_int8; typedef signed char yytype_int8; typedef yytype_int8 yy_state_t; yet they don't show up in the buildfarm typedefs output. It's not a thing of the binary, I checked that the symbols are present. I have a hard time parsing the buildfarm code for generating the typedefs file, tbh. <stare> Ah, I see. If I interpret that correctly, the code filters out symbols it doesn't find in in some .[chly] file in the *source* directory. This code is, uh, barely readable and massively underdocumented. I guess I need to reimplement that :/. Don't immediately see how this could be implemented for in-tree autoconf builds... > > But in the attached patch I've implemented this slightly differently. If the > > tooling to do so is available, the indent-* targets explained above, > > use/depend on src/tools/pgindent/typedefs.list.merged (in the build dir), > > which is the combination of a src/tools/pgindent/typedefs.list.local generated > > for the local binaries/libraries and the source tree > > src/tools/pgindent/typedefs.list. > > Hmm ... that allows indenting your C files, but how do you get from that > to a non-noisy patch to commit to typedefs.list? It doesn't provide that on its own. Being able to painlessly indent the files seems pretty worthwhile already. But clearly it'd much better if we can automatically update typedefs.list. Greetings, Andres Freund
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix comment from commit 22655aa231.
- 01529c704008 17.0 cited
-
Add a few recent commits to .git-blame-ignore-revs.
- 0df7d1da40e3 17.0 landed
-
Pre-beta2 mechanical code beautification.
- b334612b8aee 16.0 landed
-
Pre-beta mechanical code beautification.
- 0245f8db36f3 16.0 landed
-
Make agreed-on updates in perltidy options.
- df6b19fbbc20 16.0 landed
-
Remove obsolete pgindent options --code-base and --build
- b16259b3c189 16.0 landed
-
Integrate pg_bsd_indent into our build/test infrastructure.
- 156c049beed9 16.0 landed
-
Sync pg_bsd_indent's copyright notices with Postgres practice.
- b44e5fced3e5 16.0 landed
-
Import pg_bsd_indent sources.
- 4e831f4cee14 16.0 landed
-
pgindent: filter files for the --commit option
- dab07e8c6896 16.0 landed
-
pgindent: more ways to find files to indent
- 068a243b7771 16.0 landed
-
Fix pgindent --show-diff option.
- 62e1e28bf769 16.0 cited
-
Add non-destructive modes to pgindent
- b90f0b57474e 16.0 landed
-
Initial pgindent run with pg_bsd_indent version 2.0.
- e3860ffa4dd0 10.0 cited