Commit Graph

87 Commits

Author SHA1 Message Date
Tom Lane df6b19fbbc Make agreed-on updates in perltidy options.
Our standard version of perltidy is now 20230309.
Add a --valign-exclusion-list setting to reduce crosstalk
between nearby lines of Perl code.

Also, update instructions for running pgindent
(missed in b16259b3c).

Discussion: https://postgr.es/m/20230428092545.qfb3y5wcu4cm75ur@alvherre.pgsql
2023-05-19 16:43:57 -04:00
Tom Lane 0ec0e20955 Doc: update pgindent/README some more.
In commit 2e6ba1315, I missed that there was a redundant
second reference to pg_bsd_indent's old repo.
2023-04-22 11:52:46 -04:00
Tom Lane 2e6ba13152 Doc: update pgindent/README.
I missed updating this when we pulled pg_bsd_indent into the tree.
2023-04-02 20:01:34 -04:00
Andrew Dunstan e0d70a91a0 Document installing perltidy with cpanm
Installing with plain cpan failed for me recently, as the archive it
searched has been purged of old releases. However, you can give cpanm a
complete URL to the exact version you want to install, so document using
that.
2023-02-02 08:54:38 -05:00
Peter Geoghegan bc49ab3c27 Improve pgindent release workflow.
Update RELEASE_CHANGES to direct the reader towards completing the steps
outlined in the pgindent README, both as a pre-beta task and as a task
to be performed when starting a new development cycle.

This makes it less likely that somebody will miss updating the
.git-blame-ignore-revs file when running pgindent against the tree as a
routine release change task.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAH2-Wz=2PjF4As8dWECArsXxLKganYmQ-s0UeGqHHbHhqDKqeA@mail.gmail.com
2021-06-28 13:08:46 -07:00
Peter Geoghegan 8e638845ff Add list of ignorable pgindent commits for git-blame.
Add a .git-blame-ignore-revs file with a list of pgindent, pgperlyidy,
and reformat-dat-files commit hashes.  Postgres hackers that configure
git to use the ignore file will get git-blame output that avoids
attributing line changes to the ignored indent commits.  This makes
git-blame output much easier to work with in practice.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAH2-Wz=cVh3GHTP6SdLU-Gnmt2zRdF8vZkcrFdSzXQ=WhbWm9Q@mail.gmail.com
2021-06-22 09:06:32 -07:00
Tom Lane c4133ec169 Exclude fmgrprotos.h from pgindent processing.
pgindent messes up entries in this file if their names match
typedef names.  While there's reason to avoid choosing conflicting
names, we have some historical exceptions, and there's no guarantee
that more duplicates won't appear in future.  Since this is a derived
file anyway, there's little harm in just excluding it.

I said yesterday that all our derived files are pgindent-clean, or else
explicitly excluded from indentation, but I'd forgotten about this one.
Now that project is really done, as confirmed by a test run.

Discussion: https://postgr.es/m/79ed5348-be7a-b647-dd40-742207186a22@2ndquadrant.com
2020-09-22 11:32:10 -04:00
Tom Lane 74d4608f50 Further improve pgindent's list of file exclusions.
I despair of people keeping the README file's notes in sync with
the actual exclusion list, so move the notes into the exclusion file.
Adjust the pgindent script to explicitly ignore comments in the file,
just in case (though it's hard to believe any would match filenames).

Extend the list so that it doesn't process any files we'd not wish it to
even in a fully-built-out development directory.  (There are still a
couple of derived files that it wants to reformat, but fixing the
generator scripts for those seems like fit material for a separate patch.)

Discussion: https://postgr.es/m/79ed5348-be7a-b647-dd40-742207186a22@2ndquadrant.com
2020-09-17 14:16:18 -04:00
Tom Lane add105840b Improve formatting of create_help.pl and plperl_opmask.pl output.
Adjust the whitespace in the emitted files so that it matches
what pgindent would do.  This makes the generated files look
like they match project style, and avoids confusion if someone
does run pgindent on the generated files.

Also, add probes.h to pgindent's exclusion list, because it can
confuse pgindent, plus there's not much point in processing it.

Daniel Gustafsson, additional fixes by me

Discussion: https://postgr.es/m/79ed5348-be7a-b647-dd40-742207186a22@2ndquadrant.com
2020-09-16 20:31:37 -04:00
Michael Paquier 66bde49d96 Fix inconsistencies and typos in the tree, take 10
This addresses some issues with unnecessary code comments, fixes various
typos in docs and comments, and removes some orphaned structures and
definitions.

Author: Alexander Lakhin
Discussion: https://postgr.es/m/9aabc775-5494-b372-8bcb-4dfc0bd37c68@gmail.com
2019-08-13 13:53:41 +09:00
Tom Lane 9e1c9f9594 pgindent run prior to branching v12.
pgperltidy and reformat-dat-files too, though the latter didn't
find anything to change.
2019-07-01 12:37:52 -04:00
Tom Lane b09a64d602 Add missing pg_description strings for pg_type entries.
I noticed that all non-composite, non-array entries in pg_type.dat
had descr strings, except for "json" and the pseudo-types.  The
lack for json seems certainly an oversight, and there's surely
little reason to not have entries for the pseudo-types either.
So add some.

"make reformat-dat-files" turned up some formatting issues in
pg_amop.dat, too, so fix those in passing.

No catversion bump since the backend doesn't care too much what is
in pg_description.
2018-09-20 16:06:18 -04:00
Tom Lane 46cda5bf7b Change pgindent/README to specify that we use perltidy version 20170521.
Per discussion, this is now the project's standard version.
Update the obsolete URL, and explain how to install a specific version.

Discussion: https://postgr.es/m/CABUevEzK3cNiHZQ18f5tK0guoT+cN_jWeVzhYYxY=r+1Q3SmoA@mail.gmail.com
2018-04-25 13:58:39 -04:00
Tom Lane 81f056c725 Remove entab and associated detritus.
We don't need this anymore, because pg_bsd_indent has been taught to
follow the same tab-vs-space rules that entab used to enforce.

Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 15:46:39 -04:00
Tom Lane 8ff6d4ec78 Adjust pgindent script to use pg_bsd_indent 2.0.
Update version-checking code and list of switches.  Delete obsolete
quasi-support for using GNU indent.  Remove a lot of no-longer-needed
workarounds for bugs of the old version, and improve comments for
the hacks that remain.  Update run_build() subroutine to fetch the
pg_bsd_indent code from the newly established git repo for it.

In passing, fix pgindent to not overwrite files that require no changes;
this makes it a bit more friendly to run on a built tree.

Adjust relevant documentation.

Remove indent.bsd.patch; it's not relevant anymore (and was obsolete
long ago anyway).  Likewise remove pgcppindent, since we're no longer
in the business of shipping C++ code.

Piotr Stefaniak is responsible for most of the algorithmic changes
to the pgindent script; I did the rest.

Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 14:26:21 -04:00
Tom Lane cea258b63d Teach pgindent to skip files generated by bison or flex automatically.
If a .c or .h file corresponds to a .y or .l file, skip indenting it.
There's no point in reindenting derived files, and these files tend to
confuse pgindent.  (Which probably indicates a bug in BSD indent, but
I can't get excited about trying to fix it.)

For the same reasons, add src/backend/utils/fmgrtab.c to the set of
files excluded by src/tools/pgindent/exclude_file_patterns.

The point of doing this is that it makes it safe to run pgindent over
the tree without doing "make maintainer-clean" first.  While these are
not the only derived .c/.h files in the tree, they are the only ones
pgindent fails on.  Removing that prerequisite step results in one less
way to mess up a pgindent run, and it's necessary if we ever hope to get
to the ease of running pgindent via "make indent".
2017-06-16 23:14:40 -04:00
Magnus Hagander f61bd73993 Update URLs in pgindent source and README
Website and buildfarm is https, not http, and the ftp protocol will be
shut down shortly.
2017-05-23 13:58:11 -04:00
Bruce Momjian df238b43d7 Add download URL for perltidy version v20090616 2017-05-17 15:29:37 -04:00
Tom Lane 05d8dec690 Simplify the process of perltidy'ing our Perl files.
Wrap the perltidy invocation into a shell script to reduce the risk of
copy-and-paste errors.  Include removal of *.bak files in the script,
so they don't accidentally get committed.  Improve the directions in
the README file.
2016-08-15 11:32:09 -04:00
Noah Misch b098abf905 Document the authoritative version of perltidy.
Every whole-tree perltidy run has used this version, firmly establishing
it as the de facto standard.
2016-06-12 04:19:44 -04:00
Bruce Momjian ab959cc0ea pgindent: add typedef blog URL 2015-06-01 11:27:30 -04:00
Bruce Momjian 3503003eb7 pgindent: document location of "all" typedef lists 2015-05-25 16:53:51 -04:00
Bruce Momjian 8339e70da6 pgindent: fix typo
Report by Michael Paquier
2015-05-25 08:08:41 -04:00
Bruce Momjian 266b6984cd pgindent: more doc updates for skipping __asm__ files 2015-05-24 21:51:42 -04:00
Bruce Momjian 58affdfb88 Improve pgindent instructions regarding Perl backup files 2015-05-23 21:09:00 -04:00
Bruce Momjian 7c7b1f4ae5 Improve pgindent test instructions 2014-05-06 15:33:38 -04:00
Bruce Momjian 2fc80e8e83 Rename 'gmake' to 'make' in docs and recommended commands
This simplifies the docs and makes it easier to cut/paste command lines.
2014-02-12 17:29:19 -05:00
Bruce Momjian 9af4159fce pgindent run for release 9.3
This is the first run of the Perl-based pgindent script.  Also update
pgindent instructions.
2013-05-29 16:58:43 -04:00
Peter Eisentraut 8e6c8da16a pgindent: Fix order in instructions
The previous order of steps didn't literally work, because git clean
-fdx would delete the downloaded typedefs.list.  Also, pgindent needs to
be called with a path when one is in at the top of the build tree.
2013-02-14 21:40:05 -05:00
Bruce Momjian 149ac7d455 Replace pgindent shell script with Perl script. Update perltidy
instructions to perltidy Perl files that lack Perl file extensions.

pgindent Perl coding by Andrew Dunstan, restructured by me.
2012-08-04 12:41:21 -04:00
Bruce Momjian 47463a8098 Remove 'for' loop perltidy argument, and move args to perltidyrc file.
Backpatch to 9.2.

Per suggestion from Noah Misch
2012-06-16 10:12:50 -04:00
Bruce Momjian 0acd978259 In pgindent, suppress reading the perltidy RC file using --noprofile. 2012-06-15 22:50:02 -04:00
Bruce Momjian d6e0207437 Update pgindent Perl indentation instructions based on feedback from
Àlvaro and Noah Misch.

Backpatch to 9.2.
2012-06-15 22:43:23 -04:00
Bruce Momjian 60801944fa Update pgindent install instructions and update typedef list. 2012-06-10 15:15:31 -04:00
Peter Eisentraut 621eb156f1 Add installing entab to pgindent instructions
And minor other pgindent documentation tweaks.
2012-03-21 23:33:10 +02:00
Robert Haas dc3f33f6be Fix pathname in pgindent README.
Kevin Grittner
2012-01-09 13:31:58 -05:00
Bruce Momjian 7260a0d00a Document that perl needs to be indented during the pgindent run. 2011-11-28 21:56:58 -05:00
Bruce Momjian 6e22ba03a9 Modify pgindent to use a renamed pg_bsd_indent binary. New features
include the ability to supply a typedef file, rather than list them on
the command line.  Also improve the README.
2011-10-12 15:51:27 -04:00
Alvaro Herrera d69149ed71 Add comment about pg_ctl stop 2011-06-10 15:27:38 -04:00
Bruce Momjian bb8f0c4b48 Mention "pg_ctl stop" in pgindent README instructions. 2011-06-09 20:51:44 -04:00
Alvaro Herrera c4d124365b Use $INDENT rather than indent throughout the pgindent code
This allows the user to change the path to be used more easily.
Also, change URL in README.
2011-02-17 22:20:19 -03:00
Bruce Momjian 97116ca417 Rename macro DECIMAL to DECIMAL_T to help pgindent; this is already
done for a few other macros in that file, for other reasons.  I also
remove pgindent/README mention of the file.
2011-02-06 10:48:17 -05:00
Peter Eisentraut fc946c39ae Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
Magnus Hagander 9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Peter Eisentraut 3f11971916 Remove extra newlines at end and beginning of files, add missing newlines
at end of files.
2010-08-19 05:57:36 +00:00
Bruce Momjian 9e15b476de Mention why one C file fails pgindent. 2010-07-06 19:26:28 +00:00
Bruce Momjian 52783b212c Update pgindent testing instructions. 2010-07-06 19:18:19 +00:00
Andrew Dunstan 799c0d3f65 Use a file of patterns of filenames to exclude from pgindent runs, instead if using multiple invocations of egrep. Add perl ppport.h to the current list. 2010-04-01 14:44:39 +00:00
Bruce Momjian 4b0f822c77 Suggest gmake installcheck-world for pgindent testing. 2010-02-26 18:00:15 +00:00
Bruce Momjian 2cc6ff45f8 Revert pgindent changes to ecpg include files that are part of ecpg
regession test output, and update pgindent script to avoid them in the
future.
2010-02-26 17:07:55 +00:00