mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	checkpatch: test for non-standard signatures
Warn on non-standard signature styles. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
		
							parent
							
								
									b34a26f315
								
							
						
					
					
						commit
						ce0338df3c
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -1600,13 +1600,17 @@ sub process {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Check signature styles
 | 
					# Check signature styles
 | 
				
			||||||
		if (!$in_header_lines &&
 | 
							if (!$in_header_lines &&
 | 
				
			||||||
		    $line =~ /^(\s*)($signature_tags)(\s*)(.*)/) {
 | 
							    $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) {
 | 
				
			||||||
			my $space_before = $1;
 | 
								my $space_before = $1;
 | 
				
			||||||
			my $sign_off = $2;
 | 
								my $sign_off = $2;
 | 
				
			||||||
			my $space_after = $3;
 | 
								my $space_after = $3;
 | 
				
			||||||
			my $email = $4;
 | 
								my $email = $4;
 | 
				
			||||||
			my $ucfirst_sign_off = ucfirst(lc($sign_off));
 | 
								my $ucfirst_sign_off = ucfirst(lc($sign_off));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								if ($sign_off !~ /$signature_tags/) {
 | 
				
			||||||
 | 
									WARN("BAD_SIGN_OFF",
 | 
				
			||||||
 | 
									     "Non-standard signature: $sign_off\n" . $herecurr);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			if (defined $space_before && $space_before ne "") {
 | 
								if (defined $space_before && $space_before ne "") {
 | 
				
			||||||
				WARN("BAD_SIGN_OFF",
 | 
									WARN("BAD_SIGN_OFF",
 | 
				
			||||||
				     "Do not use whitespace before $ucfirst_sign_off\n" . $herecurr);
 | 
									     "Do not use whitespace before $ucfirst_sign_off\n" . $herecurr);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue