From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751674AbdKVQM4 (ORCPT ); Wed, 22 Nov 2017 11:12:56 -0500 Received: from smtprelay0163.hostedemail.com ([216.40.44.163]:60037 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751460AbdKVQMz (ORCPT ); Wed, 22 Nov 2017 11:12:55 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960:967:968:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2525:2560:2563:2682:2685:2828:2859:2892:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3653:3865:3866:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:5007:9025:10004:10249:10400:10848:11026:11232:11473:11658:11914:12043:12296:12555:12740:12760:12895:13069:13095:13311:13357:13439:14181:14659:14721:21080:21433:21451:21627:30054:30070:30075:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: straw11_194afee79ff34 X-Filterd-Recvd-Size: 2597 Message-ID: <1511367172.6989.94.camel@perches.com> Subject: Re: [PATCH v4] checkpatch: allow long lines containing URL From: Joe Perches To: Andreas Brauchli , Andy Whitcroft , Andrew Morton Cc: linux-kernel@vger.kernel.org Date: Wed, 22 Nov 2017 08:12:52 -0800 In-Reply-To: <1511355432.12667.15.camel@elementarea.net> References: <1511355432.12667.15.camel@elementarea.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-11-22 at 13:57 +0100, Andreas Brauchli wrote: > Allow lines with URL to exceed the 80 char limit for improved > interaction in adaption to ongoing but undocumented practice. Acked-by: Joe Perches > $ git grep -E '://\S{77}.*' -- '*.[ch]' > > As per RFC3986 [1], the URL format allows for alphanum, +, - and . > characters in the scheme before the separator :// as long as it starts > with a letter (e.g. https, git, f.-+). > > Recognition of URIs without more context information is prone to false > positives and thus currently left out of the heuristics. > > $rawline is used in the check as comments are removed from $line. > > [1] https://tools.ietf.org/html/rfc3986#section-3.1 > > Signed-off-by: Andreas Brauchli > --- > scripts/checkpatch.pl | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 95cda3ecc66b..8e4c4ee9811a 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -2875,6 +2875,7 @@ sub process { > # logging functions like pr_info that end in a string > # lines with a single string > # #defines that are a single string > +# lines with an RFC3986 like URL > # > # There are 3 different line length message types: > # LONG_LINE_COMMENT a comment starts before but extends beyond $max_line_length > @@ -2906,6 +2907,10 @@ sub process { > $line =~ /^\+\s*(?:\w+)?\s*DEFINE_PER_CPU/) { > $msg_type = ""; > > + # URL ($rawline is used in case the URL is in a comment) > + } elsif ($rawline =~ /^\+.*\b[a-z][\w\.\+\-]*:\/\/\S+/i) { > + $msg_type = ""; > + > # Otherwise set the alternate message types > > # a comment starts before $max_line_length