pgindent run

Started by Andrew Dunstanalmost 5 years ago8 messageshackers
Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

Here's the diff from a pgindent run. The results look kosher to me - I
had to do a little surgery on queryjumble.h due to it having an unused
typedef.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Attachments:

pgindent-run-20210628.patchtext/x-patch; charset=UTF-8; name=pgindent-run-20210628.patchDownload+151-131
#2David Rowley
dgrowleyml@gmail.com
In reply to: Andrew Dunstan (#1)
Re: pgindent run

On Tue, 29 Jun 2021 at 00:29, Andrew Dunstan <andrew@dunslane.net> wrote:

Here's the diff from a pgindent run.

--- a/src/backend/commands/policy.c
+++ b/src/backend/commands/policy.c
@@ -587,65 +587,65 @@ RemoveRoleFromObjectPolicy(Oid roleid, Oid
classid, Oid policy_id)
  /* If any roles remain, update the policy entry. */
  if (num_roles > 0)
  {
- /* This is the array for the new tuple */
- role_ids = construct_array(role_oids, num_roles, OIDOID,
-    sizeof(Oid), true, TYPALIGN_INT);
+ /* This is the array for the new tuple */
+ role_ids = construct_array(role_oids, num_roles, OIDOID,
+    sizeof(Oid), true, TYPALIGN_INT);

I wasn't too sure about the status of this one. Michael did mention it
in [1]/messages/by-id/YM0puvBnbBIZxJt2@paquier.xyz, but Tom mentioned that was on purpose to ease backpatching.
I'm not too clear on if Tom intended it should stay unindented until
"rewriting that whole function in a little bit".

David

[1]: /messages/by-id/YM0puvBnbBIZxJt2@paquier.xyz

#3Andrew Dunstan
andrew@dunslane.net
In reply to: David Rowley (#2)
Re: pgindent run

On 6/28/21 8:52 AM, David Rowley wrote:

On Tue, 29 Jun 2021 at 00:29, Andrew Dunstan <andrew@dunslane.net> wrote:

Here's the diff from a pgindent run.

--- a/src/backend/commands/policy.c
+++ b/src/backend/commands/policy.c
@@ -587,65 +587,65 @@ RemoveRoleFromObjectPolicy(Oid roleid, Oid
classid, Oid policy_id)
/* If any roles remain, update the policy entry. */
if (num_roles > 0)
{
- /* This is the array for the new tuple */
- role_ids = construct_array(role_oids, num_roles, OIDOID,
-    sizeof(Oid), true, TYPALIGN_INT);
+ /* This is the array for the new tuple */
+ role_ids = construct_array(role_oids, num_roles, OIDOID,
+    sizeof(Oid), true, TYPALIGN_INT);

I wasn't too sure about the status of this one. Michael did mention it
in [1], but Tom mentioned that was on purpose to ease backpatching.
I'm not too clear on if Tom intended it should stay unindented until
"rewriting that whole function in a little bit".

David

[1] /messages/by-id/YM0puvBnbBIZxJt2@paquier.xyz

I'll let Tom speak for himself, but I somewhat doubt he meant the code
to stay badly indented for more than a short period of time.
Unfortunately, while pgindent has code that allows protecting comments
from being formatted, it doesn't have a similar mechanism for code AFAICT.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

#4Andrew Dunstan
andrew@dunslane.net
In reply to: Andrew Dunstan (#1)
Re: pgindent run

On 6/28/21 8:29 AM, Andrew Dunstan wrote:

Here's the diff from a pgindent run. The results look kosher to me - I
had to do a little surgery on queryjumble.h due to it having an unused
typedef.

This time run against the right branch ..

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

Attachments:

pgindent-run-20210628-2.patchtext/x-patch; charset=UTF-8; name=pgindent-run-20210628-2.patchDownload+94-76
#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#3)
Re: pgindent run

Andrew Dunstan <andrew@dunslane.net> writes:

On 6/28/21 8:52 AM, David Rowley wrote:

I wasn't too sure about the status of this one. Michael did mention it
in [1], but Tom mentioned that was on purpose to ease backpatching.
I'm not too clear on if Tom intended it should stay unindented until
"rewriting that whole function in a little bit".

I'll let Tom speak for himself, but I somewhat doubt he meant the code
to stay badly indented for more than a short period of time.

I did not. If you can give me an hour or so, I'll get the patch
I previously proposed [1]/messages/by-id/1573181.1624220108@sss.pgh.pa.us committed, and then this issue will go away.

regards, tom lane

[1]: /messages/by-id/1573181.1624220108@sss.pgh.pa.us

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#5)
Re: pgindent run

I wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

I'll let Tom speak for himself, but I somewhat doubt he meant the code
to stay badly indented for more than a short period of time.

I did not. If you can give me an hour or so, I'll get the patch
I previously proposed [1] committed, and then this issue will go away.

Wait ... I did already, at 5a0f1c8c0. Are you sure you were indenting
current HEAD?

regards, tom lane

#7Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#6)
Re: pgindent run

On 6/28/21 10:44 AM, Tom Lane wrote:

I wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

I'll let Tom speak for himself, but I somewhat doubt he meant the code
to stay badly indented for more than a short period of time.

I did not. If you can give me an hour or so, I'll get the patch
I previously proposed [1] committed, and then this issue will go away.

Wait ... I did already, at 5a0f1c8c0. Are you sure you were indenting
current HEAD?

No, see revised patch. I posted at 10.13

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#7)
Re: pgindent run

Andrew Dunstan <andrew@dunslane.net> writes:

On 6/28/21 10:44 AM, Tom Lane wrote:

Wait ... I did already, at 5a0f1c8c0. Are you sure you were indenting
current HEAD?

No, see revised patch. I posted at 10.13

Right, new version looks better.

regards, tom lane