diff mbox

[ovs-dev,2/3] checkpatch: Fix matching on C filenames.

Message ID 20170809203752.16886-2-joe@ovn.org
State Accepted
Headers show

Commit Message

Joe Stringer Aug. 9, 2017, 8:37 p.m. UTC
Most of the prerequisite checks so far matched on filenames that ended
in some character followed by 'c' or 'h', rather than a filename that
ends in '.c' or '.h'. Fix this.

Signed-off-by: Joe Stringer <joe@ovn.org>
---
 utilities/checkpatch.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Ben Pfaff Aug. 9, 2017, 8:58 p.m. UTC | #1
On Wed, Aug 09, 2017 at 01:37:51PM -0700, Joe Stringer wrote:
> Most of the prerequisite checks so far matched on filenames that ended
> in some character followed by 'c' or 'h', rather than a filename that
> ends in '.c' or '.h'. Fix this.
> 
> Signed-off-by: Joe Stringer <joe@ovn.org>

Acked-by: Ben Pfaff <blp@ovn.org>
Joe Stringer Aug. 9, 2017, 11:57 p.m. UTC | #2
On 9 August 2017 at 13:58, Ben Pfaff <blp@ovn.org> wrote:
> On Wed, Aug 09, 2017 at 01:37:51PM -0700, Joe Stringer wrote:
>> Most of the prerequisite checks so far matched on filenames that ended
>> in some character followed by 'c' or 'h', rather than a filename that
>> ends in '.c' or '.h'. Fix this.
>>
>> Signed-off-by: Joe Stringer <joe@ovn.org>
>
> Acked-by: Ben Pfaff <blp@ovn.org>

Thanks, applied to master.
diff mbox

Patch

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 8b9ca0f504d3..1bb256ccd4d6 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -223,17 +223,17 @@  checks = [
      'check': lambda x: trailing_whitespace_or_crlf(x),
      'print': lambda: print_warning("Line has trailing whitespace")},
 
-    {'regex': '(.c|.h)(.in)?$', 'match_name': None,
+    {'regex': '(\.c|\.h)(\.in)?$', 'match_name': None,
      'prereq': lambda x: not is_comment_line(x),
      'check': lambda x: not if_and_for_whitespace_checks(x),
      'print': lambda: print_error("Improper whitespace around control block")},
 
-    {'regex': '(.c|.h)(.in)?$', 'match_name': None,
+    {'regex': '(\.c|\.h)(\.in)?$', 'match_name': None,
      'prereq': lambda x: not is_comment_line(x),
      'check': lambda x: not if_and_for_end_with_bracket_check(x),
      'print': lambda: print_error("Inappropriate bracing around statement")},
 
-    {'regex': '(.c|.h)(.in)?$', 'match_name': None,
+    {'regex': '(\.c|\.h)(\.in)?$', 'match_name': None,
      'prereq': lambda x: not is_comment_line(x),
      'check': lambda x: pointer_whitespace_check(x),
      'print':
@@ -267,7 +267,7 @@  std_functions = [
         ('error', 'Use ovs_error() in place of error()'),
 ]
 checks += [
-    {'regex': '(.c|.h)(.in)?$',
+    {'regex': '(\.c|\.h)(\.in)?$',
      'match_name': None,
      'prereq': lambda x: not is_comment_line(x),
      'check': regex_function_factory(function_name),