Re: pgindent versus struct members and typedefs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pgindent versus struct members and typedefs
Date
Msg-id 512380.1764717196@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgindent versus struct members and typedefs  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: pgindent versus struct members and typedefs
List pgsql-hackers
Chao Li <li.evan.chao@gmail.com> writes:
>> On Dec 3, 2025, at 06:51, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> In this case, I think pgindent is indirectly enforcing good style.
>> I do not like omitting braces around anything that's more than one
>> line; readers have to pay close attention to whether the code is
>> doing what it was intended to.

> For “one line”, do you mean only a single line of statement or one line statement plus one line comment?

In my head, a comment and a statement are two lines, and so need
wrapping braces as much as two statements would do.  I realize that
C compilers think differently, but for readability and modifiability
reasons that's the approach I take.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: pgindent versus struct members and typedefs
Next
From: Chao Li
Date:
Subject: Re: pgindent versus struct members and typedefs