Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1005219imm; Fri, 15 Jun 2018 09:37:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ8x+9bvWq2m2HjDZoIasro3KVffxLiix+GvUeV1s2BQGQzcqW5QREQ9mvtco5I7fbc/7xB X-Received: by 2002:a17:902:b285:: with SMTP id u5-v6mr2900951plr.183.1529080645520; Fri, 15 Jun 2018 09:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529080645; cv=none; d=google.com; s=arc-20160816; b=lFUODun3n2qP68mnKZsy9ONpUol7seegc3BqIO89h5/jRUrRLDmh5x+pQ4iqqE8kg9 LBTJ7z4aBGAic7lQQN7jovxXJv/2AaBhMSNJ1NgWcopPQV+e1tl2IVxJmyDv46eX8p/J LIXr9yY5pNiy6jhY7yn2IYy64V0s7WJE2yWE3X1S5SnBRuT5PIqV2lxfLfuqjH1+EMLi Fc460ZqPGY0v91dAEgOSW6iAO3qnubXJ2enO8nXAfNJ++tiXELC5tmPIlbC4bjfoO4uP DwwDSk8TUVvCwPbSX1ho1A6s6VK48hT6aOstn0sW/YhpnzS4Dk9Xf75gBtMt8R3nNUTA u6FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=o4k1jkeyDwsQflSgXqwVCd9590Ae3M8RLaO6jeXhrtg=; b=hOGKCZij6GZFTgzBs708Sc3wft6BGMAViqv0niPMXKVKsE9v6I4O8fKSO3mheqvOE+ 3k65ZBYZNgL1D618yvyvW8u4icnH+0vIKOhGcOCvWGg3powCQpxJq9E3cJv0Rm2C8Yko PN9y5c9zHlovZJPnlk0zJopbeElrFquGPFBloB29GDAryvJoKhYPqFQh0c0v3fRBcn1C FCyWq8LSZPiBt7ExOhWZEKWQYquj5G0aMicmFdxteLvgaS4aQtNvo9Ii30USjKp4PZbb TXzgtl3k4SPNo8Q9wbnndZWja367lwqygqk03ppIOoi7v4SnCxH96nzevSGytrQ4BxPj 23Wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6-v6si6650319pgq.18.2018.06.15.09.37.11; Fri, 15 Jun 2018 09:37:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966229AbeFOQfk (ORCPT + 99 others); Fri, 15 Jun 2018 12:35:40 -0400 Received: from osg.samsung.com ([64.30.133.232]:51148 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966126AbeFOQbL (ORCPT ); Fri, 15 Jun 2018 12:31:11 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 0465122BF1; Fri, 15 Jun 2018 09:31:11 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6Gxlm-LYGIWT; Fri, 15 Jun 2018 09:31:10 -0700 (PDT) Received: from smtp.s-opensource.com (177.41.114.220.dynamic.adsl.gvt.net.br [177.41.114.220]) by osg.samsung.com (Postfix) with ESMTPSA id B204622B59; Fri, 15 Jun 2018 09:30:58 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.91) (envelope-from ) id 1fTrcm-000842-CN; Fri, 15 Jun 2018 13:30:56 -0300 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH v4 14/26] scripts/documentation-file-ref-check: get rid of false-positives Date: Fri, 15 Jun 2018 13:30:42 -0300 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the number of broken refs are smaller, improve the logic that gets rid of false-positives. Signed-off-by: Mauro Carvalho Chehab --- scripts/documentation-file-ref-check | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check index d132f756d31d..047f463cdf4b 100755 --- a/scripts/documentation-file-ref-check +++ b/scripts/documentation-file-ref-check @@ -38,16 +38,31 @@ while () { my $f = $1; my $ln = $2; - # Makefiles contain nasty expressions to parse docs - next if ($f =~ m/Makefile/); + # Makefiles and scripts contain nasty expressions to parse docs + next if ($f =~ m/Makefile/ || $f =~ m/\.sh$/); + # Skip this script next if ($f eq $scriptname); - if ($ln =~ m,\b(\S*)(Documentation/[A-Za-z0-9\_\.\,\~/\*\[\]\?+-]*),) { + if ($ln =~ m,\b(\S*)(Documentation/[A-Za-z0-9\_\.\,\~/\*\[\]\?+-]*)(.*),) { my $prefix = $1; my $ref = $2; my $base = $2; + my $extra = $3; + # some file references are like: + # /usr/src/linux/Documentation/DMA-{API,mapping}.txt + # For now, ignore them + next if ($extra =~ m/^{/); + + # Remove footnotes at the end like: + # Documentation/devicetree/dt-object-internal.txt[1] + $ref =~ s/(txt|rst)\[\d+]$/$1/; + + # Remove ending ']' without any '[' + $ref =~ s/\].*// if (!($ref =~ m/\[/)); + + # Remove puntuation marks at the end $ref =~ s/[\,\.]+$//; my $fulref = "$prefix$ref"; -- 2.17.1