The separator line always starts with three dashes on a line, optionally followed by either white-space, OR a single space and a filename. The regex would previously match on any three dashes in a row. This means that a patch (such as [1]) would trigger the parser state machine to advance beyond the signed-off checks.
Now, bound the check only to use what git-mailinfo would use as a separator. --- <filename> ---<sp> 1: https://mail.openvswitch.org/pipermail/ovs-dev/2018-June/348625.html Fixes: c599d5ccf316 ("checkpatch.py: A simple script for finding patch issues") Signed-off-by: Aaron Conole <[email protected]> --- v1->v2: Update the regex based on how git-mailinfo interprets the separator. utilities/checkpatch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py index 5a6d5f5ff..f92971438 100755 --- a/utilities/checkpatch.py +++ b/utilities/checkpatch.py @@ -619,7 +619,7 @@ def ovs_checkpatch_parse(text, filename): parse = 0 current_file = filename if checking_file else '' previous_file = '' - scissors = re.compile(r'^[\w]*---[\w]*') + seppatch = re.compile(r'^---([\w]*| \S+)$') hunks = re.compile('^(---|\+\+\+) (\S+)') hunk_differences = re.compile( r'^@@ ([0-9-+]+),([0-9-+]+) ([0-9-+]+),([0-9-+]+) @@') @@ -652,7 +652,7 @@ def ovs_checkpatch_parse(text, filename): print_file_name = current_file continue elif parse == PARSE_STATE_HEADING: - if scissors.match(line): + if seppatch.match(line): parse = PARSE_STATE_DIFF_HEADER if not skip_signoff_check: if len(signatures) == 0: -- 2.14.3 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
