pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Run the C portions of guc-file.l through pgindent.
3+ messages / 3 participants
[nested] [flat]

* pgsql: Run the C portions of guc-file.l through pgindent.
@ 2015-06-29 00:49 Tom Lane <tgl@sss.pgh.pa.us>
  2015-06-29 01:24 ` Re: pgsql: Run the C portions of guc-file.l through pgindent. Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2015-06-29 00:49 UTC (permalink / raw)
  To: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2bdc51a2946f9a66688eb705cd0cb584ebd8240a

Modified Files
--------------
src/backend/utils/misc/guc-file.l |  106 +++++++++++++++++++------------------
1 file changed, 54 insertions(+), 52 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Run the C portions of guc-file.l through pgindent.
  2015-06-29 00:49 pgsql: Run the C portions of guc-file.l through pgindent. Tom Lane <tgl@sss.pgh.pa.us>
@ 2015-06-29 01:24 ` Michael Paquier <michael.paquier@gmail.com>
  2015-06-29 14:02   ` Re: pgsql: Run the C portions of guc-file.l through pgindent. Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Michael Paquier @ 2015-06-29 01:24 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers

On Mon, Jun 29, 2015 at 9:49 AM, Tom Lane <tgl@sss.pgh.pa.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):
inline patch 1: src/tools/pgindent/pgindent (+1/-0 lines) download inline-1.patchdiff --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 -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: pgsql: Run the C portions of guc-file.l through pgindent.
  2015-06-29 00:49 pgsql: Run the C portions of guc-file.l through pgindent. Tom Lane <tgl@sss.pgh.pa.us>
  2015-06-29 01:24 ` Re: pgsql: Run the C portions of guc-file.l through pgindent. Michael Paquier <michael.paquier@gmail.com>
@ 2015-06-29 14:02   ` Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Andrew Dunstan @ 2015-06-29 14:02 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers


On 06/28/2015 09:24 PM, Michael Paquier wrote:
> On Mon, Jun 29, 2015 at 9:49 AM, Tom Lane <tgl@sss.pgh.pa.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,

Try it and see. I would expect it to blow up badly. It should be 
possible to teach pgindent to extract the C portions of the files, 
indent them and then replace them. Of course, especially in the case of 
.y files, that would exclude almost all of the files in many cases.

cheers

andrew



-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2015-06-29 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-06-29 00:49 pgsql: Run the C portions of guc-file.l through pgindent. Tom Lane <tgl@sss.pgh.pa.us>
2015-06-29 01:24 ` Michael Paquier <michael.paquier@gmail.com>
2015-06-29 14:02   ` Andrew Dunstan <andrew@dunslane.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox