All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] checkpatch: Add check item for RFC tags is outside the subject prefix
@ 2021-10-15  7:58 Cai Huoqing
  2021-10-15  7:58 ` [PATCH 2/2] docs: checkpatch: Add the description for RFC_TAG_PREFIX waining messsage Cai Huoqing
  2021-10-15 16:50 ` [PATCH 1/2] checkpatch: Add check item for RFC tags is outside the subject prefix Joe Perches
  0 siblings, 2 replies; 3+ messages in thread
From: Cai Huoqing @ 2021-10-15  7:58 UTC (permalink / raw)
  To: caihuoqing
  Cc: Dwaipayan Ray, Lukas Bulwahn, Joe Perches, Jonathan Corbet,
	Andy Whitcroft, linux-doc, linux-kernel

Some patches have been sent, the RFC tag of which is
outside the subject prefix is incorrect. like this:
"Subject: [PATCH v2] RFC:"

Perfer "Subject: [RFC PATCH v2]" to "Subject: [PATCH v2] RFC:",
so add check item for it.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c27d2312cfc3..802f78904247 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3121,6 +3121,12 @@ sub process {
 			     "A patch subject line should describe the change not the tool that found it\n" . $herecurr);
 		}
 
+# Check if RFC tags is outside the subject prefix
+		if ($in_header_lines && $line =~ /^Subject:.*patch\s*.*]\s*rfc:/i) {
+			WARN("RFC_TAG_PREFIX",
+			     "RFC tag is outside subject prefix, try \"git format-patch --rfc\"\n" . $herecurr);
+		}
+
 # Check for Gerrit Change-Ids not in any patch context
 		if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) {
 			if (ERROR("GERRIT_CHANGE_ID",
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] docs: checkpatch: Add the description for RFC_TAG_PREFIX waining messsage
  2021-10-15  7:58 [PATCH 1/2] checkpatch: Add check item for RFC tags is outside the subject prefix Cai Huoqing
@ 2021-10-15  7:58 ` Cai Huoqing
  2021-10-15 16:50 ` [PATCH 1/2] checkpatch: Add check item for RFC tags is outside the subject prefix Joe Perches
  1 sibling, 0 replies; 3+ messages in thread
From: Cai Huoqing @ 2021-10-15  7:58 UTC (permalink / raw)
  To: caihuoqing
  Cc: Dwaipayan Ray, Lukas Bulwahn, Joe Perches, Jonathan Corbet,
	Andy Whitcroft, linux-doc, linux-kernel

A check item for RFC tags is added to checkpatch.pl,
which will report RFC_TAG_PREFIX warning. so add
the description for RFC_TAG_PREFIX.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 Documentation/dev-tools/checkpatch.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-tools/checkpatch.rst
index b52452bc2963..0da827af3d93 100644
--- a/Documentation/dev-tools/checkpatch.rst
+++ b/Documentation/dev-tools/checkpatch.rst
@@ -554,6 +554,16 @@ Commit message
 
     See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes
 
+  **RFC_TAG_PREFIX**
+    RFC tag is outside subject prefix.
+    RFC tag outside subject prefix is incorrect like this::
+
+      Subject: [PATCH v2] RFC:
+
+    Perfer::
+
+      Subject: [RFC PATCH v2]
+
   **FROM_SIGN_OFF_MISMATCH**
     The author's email does not match with that in the Signed-off-by:
     line(s). This can be sometimes caused due to an improperly configured
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] checkpatch: Add check item for RFC tags is outside the subject prefix
  2021-10-15  7:58 [PATCH 1/2] checkpatch: Add check item for RFC tags is outside the subject prefix Cai Huoqing
  2021-10-15  7:58 ` [PATCH 2/2] docs: checkpatch: Add the description for RFC_TAG_PREFIX waining messsage Cai Huoqing
@ 2021-10-15 16:50 ` Joe Perches
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2021-10-15 16:50 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Dwaipayan Ray, Lukas Bulwahn, Jonathan Corbet, Andy Whitcroft,
	linux-doc, linux-kernel

On Fri, 2021-10-15 at 15:58 +0800, Cai Huoqing wrote:
> Some patches have been sent, the RFC tag of which is
> outside the subject prefix is incorrect. like this:
> "Subject: [PATCH v2] RFC:"
> 
> Perfer "Subject: [RFC PATCH v2]" to "Subject: [PATCH v2] RFC:",
> so add check item for it.

typo of prefer but does this matter enough to make it a test?

Same typo in next patch.

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -3121,6 +3121,12 @@ sub process {
>  			     "A patch subject line should describe the change not the tool that found it\n" . $herecurr);
>  		}
>  
> +# Check if RFC tags is outside the subject prefix
> +		if ($in_header_lines && $line =~ /^Subject:.*patch\s*.*]\s*rfc:/i) {
> +			WARN("RFC_TAG_PREFIX",
> +			     "RFC tag is outside subject prefix, try \"git format-patch --rfc\"\n" . $herecurr);
> +		}
> +
>  # Check for Gerrit Change-Ids not in any patch context
>  		if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) {
>  			if (ERROR("GERRIT_CHANGE_ID",



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-15 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15  7:58 [PATCH 1/2] checkpatch: Add check item for RFC tags is outside the subject prefix Cai Huoqing
2021-10-15  7:58 ` [PATCH 2/2] docs: checkpatch: Add the description for RFC_TAG_PREFIX waining messsage Cai Huoqing
2021-10-15 16:50 ` [PATCH 1/2] checkpatch: Add check item for RFC tags is outside the subject prefix Joe Perches

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.