diff mbox

[U-Boot] checkpatch: Add a check for forbidden tags in the git log

Message ID 1412675634-9122-1-git-send-email-alban.bedel@avionic-design.de
State Changes Requested
Delegated to: Tom Rini
Headers show

Commit Message

Alban Bedel Oct. 7, 2014, 9:53 a.m. UTC
After doing this error too many times myself add a check for left
over tags from gerrit and co.

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
---
 scripts/checkpatch.pl | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Tom Rini Oct. 20, 2014, 8:27 p.m. UTC | #1
On Tue, Oct 07, 2014 at 11:53:54AM +0200, Alban Bedel wrote:

> After doing this error too many times myself add a check for left
> over tags from gerrit and co.
> 
> Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
> ---
>  scripts/checkpatch.pl | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 74db2e2..3f1dedf 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -351,6 +351,15 @@ our $signature_tags = qr{(?xi:
>  	Cc:
>  )};
>  
> +our $forbidden_tags = qr{(?xi:
> +	Bug[=:]|
> +	Test[=:]|
> +	Issue:|
> +	Change-Id:|
> +	Review URL:|
> +	Reviewed-On:
> +)};
> +
>  our @typeList = (
>  	qr{void},
>  	qr{(?:unsigned\s+)?char},
> @@ -1894,6 +1903,12 @@ sub process {
>  			}
>  		}
>  
> +# Check for left over tags
> +		if ($line =~ /^\s*$forbidden_tags/i) {
> +			WARN("FORBIDDEN_TAGS",
> +			     "Do not leave extra tags (internal review marker, etc)\n" . $herecurr)
> +		}
> +
>  # Check for wrappage within a valid hunk of the file
>  		if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
>  			ERROR("CORRUPTED_PATCH",

Since we last re-synced checkpatch.pl, there's a check for just
Change-Id now.  I would suggest bringing this up with upstream to also
ignore these other tags as it's a more generic problem.  Thanks!
diff mbox

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 74db2e2..3f1dedf 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -351,6 +351,15 @@  our $signature_tags = qr{(?xi:
 	Cc:
 )};
 
+our $forbidden_tags = qr{(?xi:
+	Bug[=:]|
+	Test[=:]|
+	Issue:|
+	Change-Id:|
+	Review URL:|
+	Reviewed-On:
+)};
+
 our @typeList = (
 	qr{void},
 	qr{(?:unsigned\s+)?char},
@@ -1894,6 +1903,12 @@  sub process {
 			}
 		}
 
+# Check for left over tags
+		if ($line =~ /^\s*$forbidden_tags/i) {
+			WARN("FORBIDDEN_TAGS",
+			     "Do not leave extra tags (internal review marker, etc)\n" . $herecurr)
+		}
+
 # Check for wrappage within a valid hunk of the file
 		if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
 			ERROR("CORRUPTED_PATCH",