[ovs-dev,v2] checkpatch: Don't do line length or whitespace checks on debian/rules.

Message ID 20180416200003.3604-1-blp@ovn.org
State Accepted
Headers show
Series
  • [ovs-dev,v2] checkpatch: Don't do line length or whitespace checks on debian/rules.
Related show

Commit Message

Ben Pfaff April 16, 2018, 8 p.m.
debian/rules is a Makefile with a funny name.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
v1->v2; Avoid long line in checkpatch.

 utilities/checkpatch.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Aaron Conole April 24, 2018, 7:44 p.m. | #1
Ben Pfaff <blp@ovn.org> writes:

> debian/rules is a Makefile with a funny name.
>
> Signed-off-by: Ben Pfaff <blp@ovn.org>
> ---

Reviewed-by: Aaron Conole <aconole@redhat.com>
Ben Pfaff April 25, 2018, 3:56 p.m. | #2
On Tue, Apr 24, 2018 at 03:44:55PM -0400, Aaron Conole wrote:
> Ben Pfaff <blp@ovn.org> writes:
> 
> > debian/rules is a Makefile with a funny name.
> >
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> > ---
> 
> Reviewed-by: Aaron Conole <aconole@redhat.com>

Thanks, applied to master.

Patch

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 0f389052c1f9..11f98389f986 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -165,13 +165,13 @@  skip_signoff_check = False
 # name, as they may have legitimate reasons to have longer lines.
 #
 # Python isn't checked as flake8 performs these checks during build.
-line_length_blacklist = ['.am', '.at', 'etc', '.in', '.m4', '.mk', '.patch',
-                         '.py']
+line_length_blacklist = re.compile(
+    r'\.(am|at|etc|in|m4|mk|patch|py)$|debian/rules')
 
 # Don't enforce a requirement that leading whitespace be all spaces on
 # files that include these characters in their name, since these kinds
 # of files need lines with leading tabs.
-leading_whitespace_blacklist = ['.mk', '.am', '.at']
+leading_whitespace_blacklist = re.compile(r'\.(mk|am|at)$|debian/rules')
 
 
 def is_subtracted_line(line):
@@ -379,13 +379,13 @@  def check_comment_spelling(line):
 checks = [
     {'regex': None,
      'match_name':
-     lambda x: not any([fmt in x for fmt in line_length_blacklist]),
+     lambda x: not line_length_blacklist.match(x),
      'check': lambda x: line_length_check(x),
      'print': lambda: print_warning("Line length is >79-characters long")},
 
     {'regex': None,
      'match_name':
-     lambda x: not any([fmt in x for fmt in leading_whitespace_blacklist]),
+     lambda x: not leading_whitespace_blacklist.match(x),
      'check': lambda x: not leading_whitespace_is_spaces(x),
      'print': lambda: print_warning("Line has non-spaces leading whitespace")},