Re: run pgindent on a regular basis / scripted manner

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: Bruce Momjian <bruce@momjian.us>, Jelte Fennema <postgres@jeltef.nl>, Andres Freund <andres@anarazel.de>, Peter Geoghegan <pg@bowt.ie>, Magnus Hagander <magnus@hagander.net>, Alvaro Herrera <alvherre@2ndquadrant.com>, Stephen Frost <sfrost@snowman.net>, Jesse Zhang <sbjesse@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2023-01-29T04:22:19Z
Lists: pgsql-hackers
Noah Misch <noah@leadboat.com> writes:
> Yes, a hook intended to enforce pgindent cleanliness should run tree-wide
> pgindent when the given commit(s) change the typedef list.  typedef list
> changes essentially become another kind of refactoring that can yield merge
> conflicts.  If your commit passed the pgindent check, rebasing it onto a new
> typedefs list may require further indentation changes.  New typedefs don't
> tend to change a lot of old code, so I would expect this sort of conflict to
> be minor, compared to all the other sources of conflicts.

In fact, if a typedef addition *does* affect a lot of old code,
that's a good sign that the choice of typedef name ought to be
rethought: it's evidently conflicting with existing names.

I'm not sure what that observation implies for our standard
practices here.  But it does suggest that "let pgindent do what
it wants without human oversight" probably isn't a good plan.
We've seen that to be true for other reasons as well, notably that
it can destroy the readability of carefully-laid-out comments.

			regards, tom lane



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix comment from commit 22655aa231.

  2. Add a few recent commits to .git-blame-ignore-revs.

  3. Pre-beta2 mechanical code beautification.

  4. Pre-beta mechanical code beautification.

  5. Make agreed-on updates in perltidy options.

  6. Remove obsolete pgindent options --code-base and --build

  7. Integrate pg_bsd_indent into our build/test infrastructure.

  8. Sync pg_bsd_indent's copyright notices with Postgres practice.

  9. Import pg_bsd_indent sources.

  10. pgindent: filter files for the --commit option

  11. pgindent: more ways to find files to indent

  12. Fix pgindent --show-diff option.

  13. Add non-destructive modes to pgindent

  14. Initial pgindent run with pg_bsd_indent version 2.0.