Re: pgsql: Run the C portions of guc-file.l through pgindent.

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Run the C portions of guc-file.l through pgindent.
Date: 2015-06-29 01:24:16
Message-ID: CAB7nPqQHDOx9-pnPwLQfcbD42=efFthCvP_mKVyCzP0BMaeT8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Mon, Jun 29, 2015 at 9:49 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Run the C portions of guc-file.l through pgindent.
>
> Yeah, I know, pretty anal-retentive of me. But we oughta find some
> way to automate this for the .y and .l files.

.y files may be tricky and .l files less. Still one good way to test
such things would be to use something like that and see at least what
happens when doing a run (haven't tested, use at your own risk):
diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent
index 0d3859d..3995214 100755
--- a/src/tools/pgindent/pgindent
+++ b/src/tools/pgindent/pgindent
@@ -519,6 +519,7 @@ File::Find::find(
(($dev, $ino, $mode, $nlink, $uid, $gid) = lstat($_))
&& -f _
&& /^.*\.[ch]\z/s
+ && /^.*\.(h|c|y|l)\z/s
&& push(@files, $File::Find::name);
}
},

Regards,
--
Michael

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2015-06-29 04:08:06 pgsql: Translation updates
Previous Message Tom Lane 2015-06-29 00:49:41 pgsql: Run the C portions of guc-file.l through pgindent.