On Fri, Mar 2, 2018 at 4:49 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:

> Magnus Hagander <mag...@hagander.net> writes:
> > On Fri, Mar 2, 2018 at 3:53 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> >> +1.  We're not that far away from it being time to run
> pgindent/perltidy,
> >> so now would be a good time to consider whether we like a newer
> version's
> >> result better.
>
> > For example, Debian ships with 20140328, which produces the attached
> diff.
> > I'm not sure if we want to go to whatever is a "common version on most
> > platforms" today, or just "whatever is latest" if we do upgrade. AFAICT
> > RHEL 7 seems to be on 20121207, RHEL 6 on 20090616. And in Ubuntu, 14.04
> > has 20120701, 16.04 has 20140328, and current devel has 20140328. In
> > general there seems to be very little overlap there, except Debian and
> > Ubuntu covers the same versions.
>
> > (Note that this diff is against HEAD -- it's possible a perltidy run with
> > the current version would also generate a diff, I have not compared them
> to
> > each other)
>
> Yeah, perltidy 20090616 already produces a pretty substantial diff on
> HEAD; attached.
>

Ah yeah, if I apply that one first, the diff from using 20140328 is much
smaller. Attached is that one, which means the difference between the two
perltidy versions.

-- 
 Magnus Hagander
 Me: https://www.hagander.net/ <http://www.hagander.net/>
 Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>
diff --git a/doc/src/sgml/mk_feature_tables.pl b/doc/src/sgml/mk_feature_tables.pl
index 9b111b8b40..476e50e66d 100644
--- a/doc/src/sgml/mk_feature_tables.pl
+++ b/doc/src/sgml/mk_feature_tables.pl
@@ -38,8 +38,8 @@ while (<$feat>)
 
 	$is_supported eq $yesno || next;
 
-	$feature_name    =~ s/</&lt;/g;
-	$feature_name    =~ s/>/&gt;/g;
+	$feature_name =~ s/</&lt;/g;
+	$feature_name =~ s/>/&gt;/g;
 	$subfeature_name =~ s/</&lt;/g;
 	$subfeature_name =~ s/>/&gt;/g;
 
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index f80f718480..9a43222dc7 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -295,7 +295,7 @@ foreach my $catname (@{ $catalogs->{names} })
 					# Omit the oid column if the catalog doesn't have them
 					next
 					  if $table->{without_oids}
-						  && $attr->{name} eq 'oid';
+					  && $attr->{name} eq 'oid';
 
 					morph_row_for_pgattr(\%row, $schema, $attr, 1);
 					print_bki_insert(\%row, @attnames);
@@ -422,11 +422,11 @@ sub morph_row_for_pgattr
 		# compare DefineAttr in bootstrap.c. oidvector and
 		# int2vector are also treated as not-nullable.
 		$row->{attnotnull} =
-		    $type->{typname} eq 'oidvector'   ? 't'
-		  : $type->{typname} eq 'int2vector'  ? 't'
-		  : $type->{typlen}  eq 'NAMEDATALEN' ? 't'
-		  : $type->{typlen} > 0 ? 't'
-		  :                       'f';
+		    $type->{typname} eq 'oidvector'  ? 't'
+		  : $type->{typname} eq 'int2vector' ? 't'
+		  : $type->{typlen} eq 'NAMEDATALEN' ? 't'
+		  : $type->{typlen} > 0              ? 't'
+		  :                                    'f';
 	}
 	else
 	{
diff --git a/src/bin/pg_archivecleanup/t/010_pg_archivecleanup.pl b/src/bin/pg_archivecleanup/t/010_pg_archivecleanup.pl
index 97b0a07f40..31c12d567f 100644
--- a/src/bin/pg_archivecleanup/t/010_pg_archivecleanup.pl
+++ b/src/bin/pg_archivecleanup/t/010_pg_archivecleanup.pl
@@ -75,8 +75,8 @@ sub run_check
 	create_files();
 
 	command_ok(
-		[   'pg_archivecleanup', '-x', '.gz', $tempdir, $walfiles[2] . $suffix
-		],
+		[   'pg_archivecleanup', '-x', '.gz', $tempdir,
+			$walfiles[2] . $suffix ],
 		"$test_name: runs");
 
 	ok(!-f "$tempdir/$walfiles[0]",
diff --git a/src/bin/pg_basebackup/t/010_pg_basebackup.pl b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
index 18ca77f952..791d16e6a3 100644
--- a/src/bin/pg_basebackup/t/010_pg_basebackup.pl
+++ b/src/bin/pg_basebackup/t/010_pg_basebackup.pl
@@ -190,7 +190,7 @@ SKIP:
 				-l "$tempdir/backup1/pg_tblspc/$_"
 				  and readlink "$tempdir/backup1/pg_tblspc/$_" eq
 				  "$tempdir/tbackup/tblspc1"
-			  } readdir($dh)),
+			} readdir($dh)),
 		"tablespace symlink was updated");
 	closedir $dh;
 
diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl b/src/bin/pgbench/t/001_pgbench_with_server.pl
index e84693d319..f3a8b16a88 100644
--- a/src/bin/pgbench/t/001_pgbench_with_server.pl
+++ b/src/bin/pgbench/t/001_pgbench_with_server.pl
@@ -374,8 +374,8 @@ my @errors = (
 	# SQL
 	[   'sql syntax error',
 		0,
-		[   qr{ERROR:  syntax error}, qr{prepared statement .* does not exist}
-		],
+		[   qr{ERROR:  syntax error},
+			qr{prepared statement .* does not exist} ],
 		q{-- SQL syntax error
     SELECT 1 + ;
 } ],
diff --git a/src/include/catalog/duplicate_oids b/src/include/catalog/duplicate_oids
index 7342d618ed..945fcf2b1d 100755
--- a/src/include/catalog/duplicate_oids
+++ b/src/include/catalog/duplicate_oids
@@ -15,11 +15,11 @@ while (<>)
 	next if /^CATALOG\(.*BKI_BOOTSTRAP/;
 	next
 	  unless /^DATA\(insert *OID *= *(\d+)/
-		  || /^CATALOG\([^,]*, *(\d+).*BKI_ROWTYPE_OID\((\d+)\)/
-		  || /^CATALOG\([^,]*, *(\d+)/
-		  || /^DECLARE_INDEX\([^,]*, *(\d+)/
-		  || /^DECLARE_UNIQUE_INDEX\([^,]*, *(\d+)/
-		  || /^DECLARE_TOAST\([^,]*, *(\d+), *(\d+)/;
+	  || /^CATALOG\([^,]*, *(\d+).*BKI_ROWTYPE_OID\((\d+)\)/
+	  || /^CATALOG\([^,]*, *(\d+)/
+	  || /^DECLARE_INDEX\([^,]*, *(\d+)/
+	  || /^DECLARE_UNIQUE_INDEX\([^,]*, *(\d+)/
+	  || /^DECLARE_TOAST\([^,]*, *(\d+), *(\d+)/;
 	$oidcounts{$1}++;
 	$oidcounts{$2}++ if $2;
 }
diff --git a/src/test/checksum/t/001_standby_checksum.pl b/src/test/checksum/t/001_standby_checksum.pl
index 290a74fc7c..1bffaf5de5 100644
--- a/src/test/checksum/t/001_standby_checksum.pl
+++ b/src/test/checksum/t/001_standby_checksum.pl
@@ -36,11 +36,11 @@ $node_master->safe_psql('postgres',
 
 # Check that checksums are turned off
 my $result = $node_master->safe_psql('postgres',
-	"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
+"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
 is($result, "off", 'ensure checksums are turned off on master');
 
 $result = $node_standby_1->safe_psql('postgres',
-	"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
+"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
 is($result, "off", 'ensure checksums are turned off on standby_1');
 
 # Enable checksums for the cluster
@@ -48,7 +48,7 @@ $node_master->safe_psql('postgres', "SELECT pg_enable_data_checksums();");
 
 # Ensure that the master has switched to inprogress immediately
 $result = $node_master->safe_psql('postgres',
-	"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
+"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
 is($result, "inprogress", 'ensure checksums are in progress on master');
 
 # Wait for checksum enable to be replayed
@@ -56,31 +56,32 @@ $node_master->wait_for_catchup($node_standby_1, 'replay');
 
 # Ensure that both standbys have switched to inprogress
 $result = $node_standby_1->safe_psql('postgres',
-	"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
+"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
 is($result, "inprogress", 'ensure checksums are in progress on standby_1');
 
 # Insert some more data which should be checksummed on INSERT
-$node_master->safe_psql('postgres', "INSERT INTO t VALUES (generate_series(1,10000));");
+$node_master->safe_psql('postgres',
+	"INSERT INTO t VALUES (generate_series(1,10000));");
 
 # Wait for checksums enabled on the master
 for (my $i = 0; $i < $MAX_TRIES; $i++)
 {
 	$result = $node_master->safe_psql('postgres',
-		"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
+"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
 	last if ($result eq 'on');
 	sleep(1);
 }
-is ($result, "on", 'ensure checksums are enabled on master');
+is($result, "on", 'ensure checksums are enabled on master');
 
 # Wait for checksums enabled on the standby
 for (my $i = 0; $i < $MAX_TRIES; $i++)
 {
 	$result = $node_standby_1->safe_psql('postgres',
-		"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
+"SELECT setting FROM pg_catalog.pg_settings WHERE name = 'data_checksums';");
 	last if ($result eq 'on');
 	sleep(1);
 }
-is ($result, "on", 'ensure checksums are enabled on standby');
+is($result, "on", 'ensure checksums are enabled on standby');
 
 $result = $node_master->safe_psql('postgres', "SELECT count(a) FROM t");
-is ($result, "20000", 'ensure we can safely read all data');
+is($result, "20000", 'ensure we can safely read all data');
diff --git a/src/test/modules/test_pg_dump/t/001_base.pl b/src/test/modules/test_pg_dump/t/001_base.pl
index fca00c6478..efd4e2446d 100644
--- a/src/test/modules/test_pg_dump/t/001_base.pl
+++ b/src/test/modules/test_pg_dump/t/001_base.pl
@@ -469,8 +469,9 @@ my %tests = (
 			pg_dumpall_globals => 1,
 			section_post_data  => 1, }, },
 
-	'GRANT SELECT(col2) ON regress_pg_dump_table TO regress_dump_test_role' =>
-	  { create_order => 4,
+	'GRANT SELECT(col2) ON regress_pg_dump_table TO regress_dump_test_role'
+	  => {
+		create_order => 4,
 		create_sql   => 'GRANT SELECT(col2) ON regress_pg_dump_table
 						   TO regress_dump_test_role;',
 		regexp => qr/^
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index b7c5157ff6..692d6b5226 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -1658,8 +1658,8 @@ to check for timeout. retval is undef on timeout.
 
 sub pg_recvlogical_upto
 {
-	my ($self, $dbname, $slot_name, $endpos, $timeout_secs, %plugin_options) =
-	  @_;
+	my ($self, $dbname, $slot_name, $endpos, $timeout_secs, %plugin_options)
+	  = @_;
 	my ($stdout, $stderr);
 
 	my $timeout_exception = 'pg_recvlogical timed out';
diff --git a/src/test/perl/RecursiveCopy.pm b/src/test/perl/RecursiveCopy.pm
index 5bce720b35..baf5d0ac63 100644
--- a/src/test/perl/RecursiveCopy.pm
+++ b/src/test/perl/RecursiveCopy.pm
@@ -71,7 +71,7 @@ sub copypath
 	{
 		croak "if specified, filterfn must be a subroutine reference"
 		  unless defined(ref $params{filterfn})
-			  and (ref $params{filterfn} eq 'CODE');
+		  and (ref $params{filterfn} eq 'CODE');
 
 		$filterfn = $params{filterfn};
 	}
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index f0931f1770..0d7683b103 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -978,7 +978,7 @@ sub GenerateContribSqlFiles
 				print "Building $out from $in (contrib/$n)...\n";
 				my $cont = Project::read_file("contrib/$n/$in");
 				my $dn   = $out;
-				$dn   =~ s/\.sql$//;
+				$dn =~ s/\.sql$//;
 				$cont =~ s/MODULE_PATHNAME/\$libdir\/$dn/g;
 				my $o;
 				open($o, '>', "contrib/$n/$out")
diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm
index 9817b9439a..7ccfd7bf2f 100644
--- a/src/tools/msvc/Project.pm
+++ b/src/tools/msvc/Project.pm
@@ -192,7 +192,7 @@ sub AddDir
 		{
 			next
 			  if $subdir eq "\$(top_builddir)/src/timezone"
-			;    #special case for non-standard include
+			  ;    #special case for non-standard include
 			next
 			  if $reldir . "/" . $subdir eq "src/backend/port/darwin";
 
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 04133c8a21..e4ff6125c9 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -51,7 +51,7 @@ sub _new
 	  unless $options->{wal_blocksize};    # undef or 0 means default
 	die "Bad wal_blocksize $options->{wal_blocksize}"
 	  unless grep { $_ == $options->{wal_blocksize} }
-		  (1, 2, 4, 8, 16, 32, 64);
+	  (1, 2, 4, 8, 16, 32, 64);
 	$options->{wal_segsize} = 16
 	  unless $options->{wal_segsize};      # undef or 0 means default
 	die "Bad wal_segsize $options->{wal_segsize}"
@@ -176,8 +176,7 @@ s{PG_VERSION_STR "[^"]+"}{PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, c
 		  "\n";
 		print $o "#define RELSEG_SIZE ",
 		  (1024 / $self->{options}->{blocksize}) *
-		  $self->{options}->{segsize} *
-		  1024, "\n";
+		  $self->{options}->{segsize} * 1024, "\n";
 		print $o "#define XLOG_BLCKSZ ",
 		  1024 * $self->{options}->{wal_blocksize}, "\n";
 
diff --git a/src/tools/msvc/gendef.pl b/src/tools/msvc/gendef.pl
index 9b5bc081e1..806f1576c5 100644
--- a/src/tools/msvc/gendef.pl
+++ b/src/tools/msvc/gendef.pl
@@ -155,8 +155,8 @@ sub usage
 
 usage()
   unless scalar(@ARGV) == 2
-	  && (   ($ARGV[0] =~ /\\([^\\]+$)/)
-		  && ($ARGV[1] eq 'Win32' || $ARGV[1] eq 'x64'));
+  && ( ($ARGV[0] =~ /\\([^\\]+$)/)
+	&& ($ARGV[1] eq 'Win32' || $ARGV[1] eq 'x64'));
 my $defname  = uc $1;
 my $deffile  = "$ARGV[0]/$defname.def";
 my $platform = $ARGV[1];
diff --git a/src/tools/pginclude/pgcheckdefines b/src/tools/pginclude/pgcheckdefines
index aa7c9c2fc1..dd12feeca2 100755
--- a/src/tools/pginclude/pgcheckdefines
+++ b/src/tools/pginclude/pgcheckdefines
@@ -58,7 +58,7 @@ while (<$pipe>)
 	chomp;
 	push @hfiles, $_
 	  unless m|^src/include/port/|
-		  || m|^src/backend/port/\w+/|;
+	  || m|^src/backend/port/\w+/|;
 }
 close $pipe or die "$FIND failed: $!";
 

Reply via email to