Message ID | 20200107154442.17372-2-kieran.bingham@ideasonboard.com |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Kieran, Thank you for the patch. On Tue, Jan 07, 2020 at 03:44:40PM +0000, Kieran Bingham wrote: > 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. > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > utils/checkstyle.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/utils/checkstyle.py b/utils/checkstyle.py > index 335e58f5fddf..41cd3371e81e 100755 > --- a/utils/checkstyle.py > +++ b/utils/checkstyle.py > @@ -102,7 +102,7 @@ class DiffHunkSide(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): > match = DiffHunk.diff_header_regex.match(line)
diff --git a/utils/checkstyle.py b/utils/checkstyle.py index 335e58f5fddf..41cd3371e81e 100755 --- a/utils/checkstyle.py +++ b/utils/checkstyle.py @@ -102,7 +102,7 @@ class DiffHunkSide(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): match = DiffHunk.diff_header_regex.match(line)
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. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- utils/checkstyle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)