diff options
author | Akira Yokosawa <akiyks@gmail.com> | 2022-04-04 09:20:00 +0900 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2022-04-03 20:33:45 -0700 |
commit | def3e6eb51ab06de55b89659969a2281c1f33cef (patch) | |
tree | ca73f7f81afa606ce60766e2eb9e415735125c07 /utilities | |
parent | dc03ec5dc877a1d4984431f67b25700c4b16fd6a (diff) | |
download | perfbook-def3e6eb51ab06de55b89659969a2281c1f33cef.tar.gz |
punctcheck.pl: Add hints in complaint messages
To help Paul (and other contributors), print a hint in front of
the violating line.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'utilities')
-rwxr-xr-x | utilities/punctcheck.pl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/utilities/punctcheck.pl b/utilities/punctcheck.pl index 8820bf9c..94cbafc9 100755 --- a/utilities/punctcheck.pl +++ b/utilities/punctcheck.pl @@ -71,6 +71,8 @@ sub check_line { $next_line =~ /\\E?QuickQuizEnd[BEM]?/ || $next_line =~ /\\end\{(quot|enum|item|sequ)/ ) { $ng -= 1; + } else { + print "vvv Hint: sentence ending with an uppercase needs \"\\\@.\" vvv\n"; } } if ($line =~ /^(?=[\s]*+[^%])[^%]*[a-z][\)\}\']*[\.\?\!][\)\}\']*\s+[^%]/ || @@ -80,21 +82,28 @@ sub check_line { if ($line =~ /^(?=[\s]*+[^%])[^%]*[a-z][\)\}\']*[\.\?\!][\)\}\']*\s+\\\\/ || $line =~ /^(?=[\s]*+[^%])[^%]*.*[\.:][\)\}\']*\s+\\\\/ ) { $ng -= 1; + } else { + print "vvv Hint: end of sentence needs new line vvv\n"; } } if ($line =~ /^(?=[\s]*+[^%])[^%]*[^~]\\cite/) { $ng += 1; if ($line =~ /^(?=[\s]*+[^%])[^%]*~\(\\cite/) { $ng -= 1; + } else { + print "vvv Hint: \\cite{} needs a \"~\" in front vvv\n"; } } if ($line =~ /^(?=[\s]*+[^%])[^%]*\\\@[\.\?\!\:][\)\}\']*\s+[^%]/){ $ng += 1; + print "vvv Hint: end of sentence needs new line vvv\n"; } if ($line =~ /[a-z][\)\}\']*\\\@[\.\?\!\:][\)\}\']*\s/) { + print "vvv Hint: should be \"xxx.\\\@\" vvv\n"; $ng += 1; } if ($line =~ /[A-Z][\)\}\']*[\.\?\!\:]\\\@[\)\}\']*\s/) { + print "vvv Hint: should be \"XXX\\\@.\" vvv\n"; $ng += 1; } if ($ng) { |