From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965389AbdKQP5L (ORCPT ); Fri, 17 Nov 2017 10:57:11 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:46187 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757339AbdKQP5C (ORCPT ); Fri, 17 Nov 2017 10:57:02 -0500 X-Google-Smtp-Source: AGs4zMb50BeYHttqINlduVD051D+X4+1ZtRkf6GcuLKKMxLNS/x6WL8/R6caNG9JbsHAWmv4ZfRcLA== Message-ID: <1510934219.2407.4.camel@elementarea.net> Subject: [PATCH] checkpatch: allow URL >80 chars From: Andreas Brauchli To: Andy Whitcroft , Joe Perches Cc: linux-kernel@vger.kernel.org Date: Fri, 17 Nov 2017 16:56:59 +0100 Content-Type: text/plain; charset="UTF-8" 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 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 it allows a maximal prefix of 4 characters to account for a URL after a comment (e.g. ' // https://...') The URL format allows for up to 5 protocol characters before the separator :// (e.g. https, git, ...). Additionally, an URL starting with a "domain.tld" or "subdomain.domain" pattern (e.g. 'www.kernel.org') is also accepted. $rawline is used in the check as comments are removed from $line. 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 8b80bac055e4..aed447923354 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2904,6 +2904,11 @@ sub process { } elsif ($line =~ /^\+.*\bEFI_GUID\s*\(/) { $msg_type = ""; + # URL (w/ minimal padding e.g. "+ // ") + } elsif ($rawline =~ /^\+.*?\b((?:\w{1,5}:\/\/|\w+\.\w+)\S+).*$/ && + length($rawline) - length($1) <= 5) { + $msg_type = ""; + # Otherwise set the alternate message types # a comment starts before $max_line_length -- 2.14.1