utils: checkstyle.py: Fix regex string literal
The checkstyle.py patch has a fault which it identified in itself when updating the regex string. --- utils/checkstyle.py +++ utils/checkstyle.py #105: : W605 invalid escape sequence '\+' + diff_header_regex = re.compile('@@ -([0-9]+)(,[0-9]+)? \+([0-9]+)(,?[0-9]+)? @@') --- 1 potential style issue detected, please review This is documented further at: https://www.flake8rules.com/rules/W605.html Update the string literal prefix to declare a raw byte string for the regex parser. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
618b5512a8
commit
32dd1a3b2f
1 changed files with 1 additions and 1 deletions
|
@ -102,7 +102,7 @@ class DiffHunkSide(object):
|
||||||
|
|
||||||
|
|
||||||
class DiffHunk(object):
|
class DiffHunk(object):
|
||||||
diff_header_regex = re.compile('@@ -([0-9]+),([0-9]+) \+([0-9]+),([0-9]+) @@')
|
diff_header_regex = re.compile(r'@@ -([0-9]+),([0-9]+) \+([0-9]+),([0-9]+) @@')
|
||||||
|
|
||||||
def __init__(self, line):
|
def __init__(self, line):
|
||||||
match = DiffHunk.diff_header_regex.match(line)
|
match = DiffHunk.diff_header_regex.match(line)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue