From d4b1471e00f6f08974db0e68d0b3e580e52d47a9 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Wed, 7 Dec 2016 16:34:55 +1300 Subject: [PATCH] Check space around '?', after ':', not before ',' (cherry picked from commit fdebe90171a5efcbf9d30ef29c3b7e62987452f8) --- xapian-maintainer-tools/xapian-check-patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xapian-maintainer-tools/xapian-check-patch b/xapian-maintainer-tools/xapian-check-patch index 9108827cb..0e379d429 100755 --- a/xapian-maintainer-tools/xapian-check-patch +++ b/xapian-maintainer-tools/xapian-check-patch @@ -215,7 +215,7 @@ QUOTELOOP: while (1) { $msg = "Whitespace before ')':"; } elsif (m!^\+.*; (\w+)([-+]{2})\)!) { $msg = "Prefer '$2$1' to '$1$2':"; - } elsif (m,^\+\s*[^#].*[\w)](?!-[->]|\+\+)([-+/*%~=<>!&|^]=?|\&\&|\|\||<<|>>),) { + } elsif (m,^\+\s*[^#].*[\w)](?!-[->]|\+\+)((?:[-+/*%~=<>!&|^]|\&\&|\|\||<<|>>)=?|[?]),) { my $op = $1; $msg = "Missing space before '$op':"; if (substr($_, $-[1] - 8, 8) eq 'operator') { @@ -231,7 +231,7 @@ QUOTELOOP: while (1) { # FIXME: |: FOO|BAR $msg = undef; } - } elsif (m@^\+\s*[^#].*[^-+](?!-[->]|\+\+)([-+/*%~=<>!&|^]=?|,|\&\&|\|\||<<|>>)(?)(?:[\w\(]| \s)@) { + } elsif (m@^\+\s*[^#].*[^-+](?!-[->]|\+\+)((?:[-+/*%~=<>!&|^]|\&\&|\|\||<<|>>)=?|[?:,])(?|::))(?:[\w\(]| \s)@) { my $op = $1; $msg = "Should have exactly one space after '$op':"; if ($op eq '~' && substr($_, $+[1]) =~ /^[A-Za-z][A-Za-z0-9_]*\(/) { @@ -253,6 +253,8 @@ QUOTELOOP: while (1) { # FIXME: |: FOO|BAR $msg = undef; } + } elsif (m@^\+[^#]*?[^#\h] +,@) { + $msg = "Space before ',':"; } elsif (m,^\+[^#]*?[^#\h] ,) { $msg = "Multiple spaces:"; } -- 2.11.4.GIT