Re: [pgadmin-hackers] Autoformatting

From: Jing Li <jingli(at)pivotal(dot)io>
To: Murtuza Zabuawala <murtuza(dot)zabuawala(at)enterprisedb(dot)com>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, Robert Eckhardt <reckhardt(at)pivotal(dot)io>, Shirley Wang <swang(at)pivotal(dot)io>, Raffi Holzer <rholzer(at)pivotal(dot)io>, "pgadmin-hackers" <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgadmin-hackers] Autoformatting
Date: 2017-09-15 06:29:48
Message-ID: caffbd43-85d2-3209-a9b0-b3c6606e7bf7@mixmax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Murtuza,
We had to put the autoformatting feature on hold for a while to focus on some
greenplum work. We have a library in progress but we're not currently far enough
along with this to submit a patch.
Thanks,~Jing

On Wed, Sep 13, 2017 1:13 AM, Murtuza Zabuawala
murtuza(dot)zabuawala(at)enterprisedb(dot)com wrote:
Hello,
Just curious to know if we are still working on this feature?

--Regards,Murtuza

On Mon, May 29, 2017 at 5:21 AM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
On Sun, May 28, 2017 at 11:54 AM, Robert Eckhardt <reckhardt(at)pivotal(dot)io> wrote:
>
>
> On Tue, May 9, 2017 at 4:26 AM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>>
>>
>> Anyhoo, The standard we try to use in pgAdmin at the moment is slightly
>> different from the example you've given. To add it into the mix...
>>
>> /* Keywords Upper, 4 space indent, commas after, AND/OR after,
>>  * no spaces after ( or before ), or around ::
>>  */
>> SELECT DISTINCT
>>     dep.deptype,
>>     dep.classid,
>>     coalesce(coc.relname, clrw.relname) AS ownertable
>> FROM
>>     pg_depend dep
>>     LEFT JOIN pg_class cl ON dep.objid = cl.oid
>>     LEFT JOIN pg_attribute att ON dep.objid = att.attrelid AND
>> dep.objsubid = att.attnum
>> WHERE
>>     dep.objid = 16385::oid AND
>>     classid IN (
>>         SELECT
>>             oid
>>         FROM
>>             pg_class
>>         WHERE
>>             relname IN ('pg_class', 'pg_constraint')
>>     )
>> ORDER BY
>>     classid,
>>     cl.relkind;
>>
>> There are some subtleties that are open to personal taste there;
>>
>> - Formatting of the sub-select - e.g. should the SELECT directly follow
>> the (, and should the rest be indented accordingly?
>>
>> - Formatting of multiple quals in the joins; e.g. should the qual
>> following the AND be on the next line, and if so, should it be indented one
>> level, or to align with the qual above? Should the first qual be on the next
>> line?
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>
> Sorry I let this linger. Let's go with the style you currently have. With
> respect to your additional comments.

To be clear, I wasn't insisting on that style - but it is (roughly)
what we try to use and what I prefer.

>
> - Sub-Select should be a new line and indented as in your example.

Sounds good.

> - For multiple quals in the joins; the qual following the AND should be on
> the next line, and should it be indented one level

OK.

Thanks!

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgadmin-hackers mailing list (pgadmin-hackers(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Murtuza Zabuawala 2017-09-15 07:52:40 [pgAdmin4][Patch]: Fix context menu fontawesome icons
Previous Message Ashesh Vashi 2017-09-15 05:22:24 pgAdmin 4 commit: Handle the executor nodes, which are unknown to the E