Message ID | 20181101150632.32493-1-blp@ovn.org |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev,1/2] checkpatch: Add explicit test for mailing list as author. | expand |
Looks good to me, thanks. Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> On Thu, Nov 1, 2018 at 8:06 AM Ben Pfaff <blp@ovn.org> wrote: > Somehow some such patches snuck through. checkpatch caught them (and the > committer missed that) but this makes it even more explicit. > > Signed-off-by: Ben Pfaff <blp@ovn.org> > --- > tests/checkpatch.at | 8 ++++++++ > utilities/checkpatch.py | 3 +++ > 2 files changed, 11 insertions(+) > > diff --git a/tests/checkpatch.at b/tests/checkpatch.at > index 8af3a8c0371e..bd7422494e33 100755 > --- a/tests/checkpatch.at > +++ b/tests/checkpatch.at > @@ -51,6 +51,14 @@ try_checkpatch \ > Commit: A" \ > "ERROR: Author A needs to sign off." > > +# Single author but somehow the mailing list is the author. > +try_checkpatch \ > + "Author: Foo Bar via dev <ovs-dev@openvswitch.org> > + Commit: A > + > + Signed-off-by: A" \ > + "ERROR: Author should not be mailing list." > + > # Sign-off for single author and different committer. > try_checkpatch \ > "Author: A > diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py > index 5f5dd8318e32..54aa4b6346db 100755 > --- a/utilities/checkpatch.py > +++ b/utilities/checkpatch.py > @@ -731,6 +731,9 @@ def ovs_checkpatch_parse(text, filename, author=None, > committer=None): > if not author: > print_error("Patch lacks author.") > continue > + if " via " in author or "@openvswitch.org" in author: > + print_error("Author should not be mailing list.") > + continue > if author in co_authors: > print_error("Author should not be also be > co-author.") > continue > -- > 2.16.1 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
diff --git a/tests/checkpatch.at b/tests/checkpatch.at index 8af3a8c0371e..bd7422494e33 100755 --- a/tests/checkpatch.at +++ b/tests/checkpatch.at @@ -51,6 +51,14 @@ try_checkpatch \ Commit: A" \ "ERROR: Author A needs to sign off." +# Single author but somehow the mailing list is the author. +try_checkpatch \ + "Author: Foo Bar via dev <ovs-dev@openvswitch.org> + Commit: A + + Signed-off-by: A" \ + "ERROR: Author should not be mailing list." + # Sign-off for single author and different committer. try_checkpatch \ "Author: A diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py index 5f5dd8318e32..54aa4b6346db 100755 --- a/utilities/checkpatch.py +++ b/utilities/checkpatch.py @@ -731,6 +731,9 @@ def ovs_checkpatch_parse(text, filename, author=None, committer=None): if not author: print_error("Patch lacks author.") continue + if " via " in author or "@openvswitch.org" in author: + print_error("Author should not be mailing list.") + continue if author in co_authors: print_error("Author should not be also be co-author.") continue
Somehow some such patches snuck through. checkpatch caught them (and the committer missed that) but this makes it even more explicit. Signed-off-by: Ben Pfaff <blp@ovn.org> --- tests/checkpatch.at | 8 ++++++++ utilities/checkpatch.py | 3 +++ 2 files changed, 11 insertions(+)