Message ID | 20170526183222.25368-1-blp@ovn.org |
---|---|
State | Accepted |
Headers | show |
On 26 May 2017 at 11:32, Ben Pfaff <blp@ovn.org> wrote: > This code would complain about the use of ovs_strerror because it > matches [^x]strerror, and the same was true in many other similar cases. > > Signed-off-by: Ben Pfaff <blp@ovn.org> Ah, good catch. I think this will match on mentions within comments too though?
On Fri, May 26, 2017 at 01:40:13PM -0700, Joe Stringer wrote: > On 26 May 2017 at 11:32, Ben Pfaff <blp@ovn.org> wrote: > > This code would complain about the use of ovs_strerror because it > > matches [^x]strerror, and the same was true in many other similar cases. > > > > Signed-off-by: Ben Pfaff <blp@ovn.org> > > Ah, good catch. I think this will match on mentions within comments too though? Does this change make a difference in that? I think that most of the checks will trigger on comments.
On 26 May 2017 at 15:17, Ben Pfaff <blp@ovn.org> wrote: > On Fri, May 26, 2017 at 01:40:13PM -0700, Joe Stringer wrote: >> On 26 May 2017 at 11:32, Ben Pfaff <blp@ovn.org> wrote: >> > This code would complain about the use of ovs_strerror because it >> > matches [^x]strerror, and the same was true in many other similar cases. >> > >> > Signed-off-by: Ben Pfaff <blp@ovn.org> >> >> Ah, good catch. I think this will match on mentions within comments too though? > > Does this change make a difference in that? I think that most of the > checks will trigger on comments. Ah, no. At some point I was considering narrowing the expression but it isn't there at the moment. Acked-by: Joe Stringer <joe@ovn.org>
On Tue, May 30, 2017 at 09:40:58AM -0700, Joe Stringer wrote: > On 26 May 2017 at 15:17, Ben Pfaff <blp@ovn.org> wrote: > > On Fri, May 26, 2017 at 01:40:13PM -0700, Joe Stringer wrote: > >> On 26 May 2017 at 11:32, Ben Pfaff <blp@ovn.org> wrote: > >> > This code would complain about the use of ovs_strerror because it > >> > matches [^x]strerror, and the same was true in many other similar cases. > >> > > >> > Signed-off-by: Ben Pfaff <blp@ovn.org> > >> > >> Ah, good catch. I think this will match on mentions within comments too though? > > > > Does this change make a difference in that? I think that most of the > > checks will trigger on comments. > > Ah, no. At some point I was considering narrowing the expression but > it isn't there at the moment. > > Acked-by: Joe Stringer <joe@ovn.org> Thanks. I applied this to master.
diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py index ec4b79e599df..945209da769c 100755 --- a/utilities/checkpatch.py +++ b/utilities/checkpatch.py @@ -219,7 +219,7 @@ checks = [ def regex_function_factory(func_name): - regex = re.compile('[^x]%s\([^)]*\)' % func_name) + regex = re.compile(r'\b%s\([^)]*\)' % func_name) return lambda x: regex.search(x) is not None
This code would complain about the use of ovs_strerror because it matches [^x]strerror, and the same was true in many other similar cases. Signed-off-by: Ben Pfaff <blp@ovn.org> --- utilities/checkpatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)