Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments
Date
Msg-id CAJ7c6TPCJz-ExBFL8q2dCkXZpUdpm=+wvTF11gDENGk39n3DYA@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments
List pgsql-hackers
Hi,

> I am afraid that would generate a lot of noises for future reviews.
>
> 2. A typo in the patch
>
> ```
> +    # Check each line except for the fist and the last one
> ```

Thanks, fixed.

> 3. As you are updating pgindent, I want to report an issue, you may address in a separate patch or just in this
patch,up to you. 
>
> See this code:
> ```
>             else
>                  /*
>                   * fetch all the rest of the page
>                   */
>                  copysize = QUEUE_PAGESIZE - curoffset;
> ```
>
> In the “else” clause, there is a multiple-line comment block, and a single line of code. Pgindent will add an empty
linebetween “else” and the comment block, which is weird. If the comment is one-line, then no empty line will be
inserted.

I didn't manage to find this code. The closest thing I see is in
src/backend/commands/async.c:

```
            else
            {
                /* fetch all the rest of the page */
                copysize = QUEUE_PAGESIZE - curoffset;
            }
```

Last time it was touched 15 years ago and pgindent processes it as expected.

> 1. I just ran the patched pgindent against a random file, then I got a lot diffs like:
>
> ```
>         /*
> -        * Direct advancement: avoid waking non-caught up backends that
> -        * aren't interested in our notifications.
> +        * Direct advancement: avoid waking non-caught up backends that aren't
> +        * interested in our notifications.
>          */
> ```

I'm not sure if this is part of the PostgreSQL code base either. My
best guess is that something is wrong with whitespaces here (tabs vs
spaces). We have plenty of multiline comments like this and from what
I can tell they are processed correctly.

--
Best regards,
Aleksander Alekseev

Attachment

pgsql-hackers by date:

Previous
From: Nishant Sharma
Date:
Subject: Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement
Next
From: shveta malik
Date:
Subject: Re: Improve pg_sync_replication_slots() to wait for primary to advance