From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751476AbdKVBFr (ORCPT ); Tue, 21 Nov 2017 20:05:47 -0500 Received: from smtprelay0101.hostedemail.com ([216.40.44.101]:60616 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751344AbdKVBFq (ORCPT ); Tue, 21 Nov 2017 20:05:46 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:541:599:967:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3653:3865:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:10004:10249:10400:10848:11026:11232:11473:11658:11914:12043:12296:12555:12740:12760:12895:13069:13095:13161:13229:13311:13357:13439:14181:14659:14721:21080:21433:21451:21627:30054: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:1,LUA_SUMMARY:none X-HE-Tag: bears18_6c68e27bcba15 X-Filterd-Recvd-Size: 2257 Message-ID: <1511312743.6989.41.camel@perches.com> Subject: Re: [PATCH v3] checkpatch: allow URL >80 chars From: Joe Perches To: Andreas Brauchli , Andy Whitcroft Cc: linux-kernel@vger.kernel.org Date: Tue, 21 Nov 2017 17:05:43 -0800 In-Reply-To: <1511301024.12439.38.camel@elementarea.net> References: <1511301024.12439.38.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 Tue, 2017-11-21 at 22:50 +0100, Andreas Brauchli wrote: > Allow URL to exceed the 80 char limit for improved interaction in > adaption to ongoing but undocumented practice. > > $ git grep -E '://\S{77}.*' -- '*.[ch]' > > The patch checks that the URL is indeed on its own line in that > only non-word (\W) and underscore characters are allowed beside the > URL (e.g. ' /* _https://..._ */') Perhaps you are overthinking it. If a line contains a URL, and it's > $max_line_length, then it's probably OK not to warn about it as as overly long line. I suggest: --- scripts/checkpatch.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 95cda3ecc66b..0e42e5ebe2f0 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 if 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