All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ignacio Peña" <ignacio.pena87@gmail.com>
To: Joe Perches <joe@perches.com>, Andy Whitcroft <apw@canonical.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ignacio Pena <ignacio.pena87@gmail.com>
Subject: [PATCH 3/3] checkpatch: suggest including testing evidence
Date: Mon, 21 Jul 2025 12:24:34 -0400	[thread overview]
Message-ID: <20250721162437.6691-3-ignacio.pena87@gmail.com> (raw)
In-Reply-To: <20250721162437.6691-1-ignacio.pena87@gmail.com>

For non-trivial changes, it's valuable to know how the change was
tested. Add a gentle suggestion when commit messages don't mention
any testing, verification, or validation.

This is a CHECK level notification, not a WARNING, as testing methods
vary greatly depending on the subsystem and type of change.

The check is skipped for very short commit messages (documentation
fixes, typos) where testing information would be excessive.

Link: https://docs.kernel.org/process/submitting-patches.html
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ignacio Pena <ignacio.pena87@gmail.com>
---
 scripts/checkpatch.pl | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 204800232..358310e6c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3319,6 +3319,16 @@ sub process {
 		      $commit_log_possible_stack_dump)) {
 			WARN("COMMIT_LOG_LONG_LINE",
 			     "Prefer a maximum 75 chars per line (possible unwrapped commit description?)\n" . $herecurr);
+
+# Suggest including test information for non-trivial changes
+		if ($in_commit_log && !$non_utf8_charset &&
+		    $line !~ /test|verify|tried|ran|checked|confirmed/i &&
+		    $commit_log_lines > 3) {
+			if ($commit_log_long_line eq "" && $commit_log_has_diff) {
+				CHECK("NO_TEST_INFO",
+				      "Consider mentioning how this change was tested\n" . $herecurr);
+			}
+		}
 			$commit_log_long_line = 1;
 		}
 
-- 
2.50.1


  parent reply	other threads:[~2025-07-21 16:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21 16:24 [PATCH 1/3] checkpatch: warn about novice phrases in commit messages Ignacio Peña
2025-07-21 16:24 ` [PATCH 2/3] checkpatch: enforce 12-char SHA for Fixes tags Ignacio Peña
2025-07-22  8:00   ` Greg Kroah-Hartman
2025-07-21 16:24 ` Ignacio Peña [this message]
2025-07-22  7:59   ` [PATCH 3/3] checkpatch: suggest including testing evidence Greg Kroah-Hartman
2025-07-22 17:58 ` [PATCH 1/3] checkpatch: warn about novice phrases in commit messages Joe Perches
2025-07-23  3:02 ` [PATCH v2 1/2] " Ignacio Peña
2025-07-23  3:02   ` [PATCH v2 2/2] checkpatch: enforce 12-char SHA for Fixes tags Ignacio Peña
2025-07-23  5:18     ` Greg Kroah-Hartman
2025-07-23  3:26   ` [PATCH v2 1/2] checkpatch: warn about novice phrases in commit messages Joe Perches
2025-07-24  3:28   ` [PATCH v3] " Ignacio Peña
2025-07-24  7:04     ` Joe Perches

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=20250721162437.6691-3-ignacio.pena87@gmail.com \
    --to=ignacio.pena87@gmail.com \
    --cc=apw@canonical.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.