public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Jon Maloy <jmaloy@redhat.com>
To: sbrivio@redhat.com, david@gibson.dropbear.id.au,
	jmaloy@redhat.com, passt-dev@passt.top
Subject: [PATCH 2/3] clang-tidy: Disable checks new in clang-tidy 23
Date: Thu, 19 Nov 2026 20:32:47 -0500	[thread overview]
Message-ID: <20261120013248.1472649-3-jmaloy@redhat.com> (raw)
In-Reply-To: <20261120013248.1472649-1-jmaloy@redhat.com>

clang-tidy 23 introduces three new checks, which make
'make clang-tidy' fail on code that's otherwise fine:

- readability-trailing-comma wants a trailing comma in every
  multi-line initialiser list, and none in single-line ones. That's
  not part of our coding style, and it reports about 30 sites
  (dhcpv6.c, ndp.c, netlink.c, pcap.c, tap.c, ...)

- readability-redundant-nested-if wants nested if statements merged
  into a single condition, also where the inner condition has side
  effects, as in bind() or setsockopt() calls, or a dedicated comment
  (util.c, tcp.c, ...). Merging those would hurt readability, much
  like the braces-around-statements checks we already disable

- bugprone-assignment-in-selection-statement, which cert-exp45-c is
  now an alias of, reports assignments in conditions (conf.c, flow.c,
  udp.c), like bugprone-assignment-in-if-condition, which we already
  disable for the same reasons

Disable these checks.

Signed-off-by: Jon Maloy <jmaloy@redhat.com>
---
 .clang-tidy | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/.clang-tidy b/.clang-tidy
index ec570f2d..6aceb44a 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -9,8 +9,11 @@ Checks:
     - "-cppcoreguidelines-init-variables"
 
     #	Dubious value over the compiler's built-in warning.  Would
-    #	increase verbosity.
+    #	increase verbosity.  Same for its broader variant, added in
+    #	clang-tidy 23, also known as cert-exp45-c
     - "-bugprone-assignment-in-if-condition"
+    - "-bugprone-assignment-in-selection-statement"
+    - "-cert-exp45-c"
 
     #	Debatable whether these improve readability, right now it would look
     #	like a mess
@@ -99,6 +102,15 @@ Checks:
     # be treated directly as a bool.
     - "-readability-implicit-bool-conversion"
 
+    # Wants trailing commas in multi-line initialiser lists, and none in
+    # single-line ones.  Not part of our coding style, and enforcing it
+    # would mean churn all over the place for no practical benefit.
+    - "-readability-trailing-comma"
+
+    # Merging nested if statements would often hurt readability, e.g.
+    # where the inner condition has side effects or a separate comment.
+    - "-readability-redundant-nested-if"
+
 WarningsAsErrors: "*"
 HeaderFileExtensions:
     - h
-- 
2.56.1


  parent reply	other threads:[~2026-11-20  1:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  1:32 [PATCH 0/3] Fix 'make clang-tidy' with " Jon Maloy
2026-11-20  1:32 ` [PATCH 1/3] clang-tidy: Also disable bugprone-signed-bitwise Jon Maloy
2026-11-20  1:32 ` Jon Maloy [this message]
2026-11-20  1:32 ` [PATCH 3/3] passt-repair: Drop redundant parentheses around stat() calls Jon Maloy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120013248.1472649-3-jmaloy@redhat.com \
    --to=jmaloy@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).