Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1135199rwb; Thu, 15 Dec 2022 06:51:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf7ZDmnX7arXZ+mVs9JbXRr8PyAZsXWh+HzB3qeM/ZQXQq54XCOrYUwBkWqxUnzZzHdTqAvj X-Received: by 2002:a17:90b:a0a:b0:223:2038:343a with SMTP id gg10-20020a17090b0a0a00b002232038343amr10686782pjb.8.1671115919363; Thu, 15 Dec 2022 06:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671115919; cv=none; d=google.com; s=arc-20160816; b=rvkv1lsNZjB046vAWbL3+NY5nIMAbEhAvJVEm9b//pJWmbVSoPLqMkmSga61J2/pi5 bxIdbcwBi7J0nHch+zTSh4Yx4r5mFBOUTTyzWHlzJKBKd5gdxtKDHalBLAq8MAP77K4M cTondzger9lBvIAZ/rp52Dkb5r0TwOXdYItRsiJIXm7qH29KfbQBttNM354l/l1Uz9Gx B7+LOg4xsmwvlOfSvK4iEnagpcWJupovYfbHuTxvBAvP/1BIXhE+pXDhmablp2P5Hjta QMa8aQDHoOoNNOXFUyz7XveRdbhVu99S4n31jsBVsAX8gJobl+ZiYOKEdaBc5AJsADHm UzIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OhcsN8S3wb1PQEoaQoX3+4y9ia6zEW/LNVV4ofKo2oI=; b=qJCeS92cNAd1TIqgDNzskyWYJFZEDYPwJue3xwQ8xUovUBzIw7FUw272w/7wFp+Bd6 kN2N4gOqB8luFAnDgRVh9H3hdNP74MiyyXPUjcZYoJ0Ks+PFamSUkk2HtPKbl0TAqK7Q 8WrdQLaQUL4VFYBKv9cfRm9f3WnVHNxTGUbmTEmBgc2BabBcF4vB0qt+4AMW8C/q3Lal HRJISGcHhFT9XODYQIw4grdrhYcIb3VzM8raSIZCnFznh8MyFM4I3MliuYbzHPSijtO7 vgqk23mIdMlreFQs8hVH8vLGVi7qf2tZ8u4MeNKBRsOfX9/AseNtPrvx4d+Wo47rvkR3 fTPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id li14-20020a17090b48ce00b00213b2bb261asi5037417pjb.33.2022.12.15.06.51.50; Thu, 15 Dec 2022 06:51:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230052AbiLOOnr (ORCPT + 68 others); Thu, 15 Dec 2022 09:43:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbiLOOni (ORCPT ); Thu, 15 Dec 2022 09:43:38 -0500 Received: from blackmesa.kw-serverwartung.de (blackmesa.kw-serverwartung.de [78.46.90.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 528FD2F016 for ; Thu, 15 Dec 2022 06:43:35 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by blackmesa.kw-serverwartung.de (Postfix) with ESMTP id 5AD807B807E; Thu, 15 Dec 2022 14:43:33 +0000 (UTC) Received: from blackmesa.kw-serverwartung.de ([127.0.0.1]) by localhost (blackmesa.kw-serverwartung.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aEN2543Ta_UB; Thu, 15 Dec 2022 14:43:30 +0000 (UTC) Received: from citadel.fritz.box (i59F4DEB3.versanet.de [89.244.222.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by blackmesa.kw-serverwartung.de (Postfix) with ESMTPSA id A589A7B80EA; Thu, 15 Dec 2022 14:43:30 +0000 (UTC) From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= To: linux-kernel@vger.kernel.org Cc: Thorsten Leemhuis , Andrew Morton , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH 1/3] checkpatch: warn when unknown tags are used for links Date: Thu, 15 Dec 2022 15:43:24 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Issue a warning when encountering URLs behind unknown tags, as Linus recently stated ```please stop making up random tags that make no sense. Just use "Link:"```[1]. That statement was triggered by an use of 'BugLink', but that's not the only tag people invented: $ git log -100000 --no-merges --format=email -P \ --grep='^\w+:[ \t]*http' | grep -Poh '^\w+:[ \t]*http' | \ sort | uniq -c | sort -rn | head -n 20 103958 Link: http 418 BugLink: http 372 Patchwork: http 280 Closes: http 224 Bug: http 123 References: http 84 Bugzilla: http 61 URL: http 42 v1: http 38 Datasheet: http 20 v2: http 9 Ref: http 9 Fixes: http 9 Buglink: http 8 v3: http 8 Reference: http 7 See: http 6 1: http 5 link: http 3 Link:http Some of these non-standard tags make it harder for external tools that rely on use of proper tags. One of those tools is the regression tracking bot 'regzbot', which looks out for "Link:" tags pointing to reports of tracked regressions. The initial idea was to use a disallow list to raise an error when encountering known unwanted tags like BugLink:; during review it was requested to use a list of allowed tags instead[2]. Link: https://lore.kernel.org/all/CAHk-=wgs38ZrfPvy=nOwVkVzjpM3VFU1zobP37Fwd_h9iAD5JQ@mail.gmail.com/ [1] Link: https://lore.kernel.org/all/15f7df96d49082fb7799dda6e187b33c84f38831.camel@perches.com/ [2] Co-developed-by: Thorsten Leemhuis Signed-off-by: Thorsten Leemhuis Signed-off-by: Kai Wasserbäch --- scripts/checkpatch.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 78cc595b98..d739ce0909 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3250,6 +3250,18 @@ sub process { $commit_log_possible_stack_dump = 0; } +# Check for odd tags before a URI/URL + if ($in_commit_log && + $line =~ /^\s*(\w+):\s*http/ && $1 ne 'Link') { + if ($1 =~ /^v(?:ersion)?\d+/i) { + WARN("COMMIT_LOG_VERSIONING", + "Patch version information should be after the --- line\n" . $herecurr); + } else { + WARN("COMMIT_LOG_USE_LINK", + "Unknown link reference '$1:', use 'Link:' instead\n" . $herecurr); + } + } + # Check for lines starting with a # if ($in_commit_log && $line =~ /^#/) { if (WARN("COMMIT_COMMENT_SYMBOL", -- 2.35.1