| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Aleksander Alekseev <aleksander(at)tigerdata(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com> |
| Subject: | Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments |
| Date: | 2026-05-04 16:40:19 |
| Message-ID: | 206322.1777912819@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Aleksander Alekseev <aleksander(at)tigerdata(dot)com> writes:
> Thanks, Nathan. Re-submitting v6 to make it visible by cfbot again and
> in order to simplify the work of reviewers a bit.
I tested the v6 patch by running it on current HEAD. Pretty nearly all
the changes it makes are improvements, but it seems like there's still
some work to be done. In particular, in src/port/inet_aton.c it
produces this diff:
--- a/src/port/inet_aton.c
+++ b/src/port/inet_aton.c
@@ -36,7 +37,8 @@
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE. */
+ * SUCH DAMAGE.
+ */
#include "c.h"
in which not all the trailing whitespace has been removed from the
first line, causing "git diff --check" to complain:
$ git diff --check
src/port/inet_aton.c:40: trailing whitespace.
+ * SUCH DAMAGE.
In this case the problem is that the cleanup pattern only accounts for
one trailing space. But a variant of this, which I think affects many
of the steps in the patch, is that there could be tab(s) there. You
should fix the patterns to allow any number of spaces/tabs at the
spots where they currently expect just one space. This might result
in finding cleanups they miss now.
Another amusing diff I noticed:
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -5713,7 +5713,7 @@ check_parent_values_in_new_partitions(Relation parent,
* 3. In case new partitions don't contain the DEFAULT partition and the
* partitioned table does not have the DEFAULT partition, the following
* should be true: the sum of the bounds of new partitions should be equal
- & to the bound of the split partition.
+ * & to the bound of the split partition.
*
* parent: partitioned table
* splitPartOid: split partition Oid
Clearly, this is somebody's off-by-one-key typo, and the correct
fix is s/&/*/. I suspect that fixing that manually is the most
expedient answer, rather than trying to make pg_bsd_indent smart
enough to DTRT.
One other nitpick is that the patch itself needs to be run through
pgperltidy (which has different opinions than your editor about
tabs vs spaces, apparently).
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nathan Bossart | 2026-05-04 17:11:23 | Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments |
| Previous Message | Tristan Partin | 2026-05-04 15:49:00 | Re: Cleanup: Replace sscanf with strtol/strtoul in snapmgr |