Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2136429imm; Thu, 14 Jun 2018 09:16:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL76aiUZaBCp/giYDko09TCT+P6fGSVQ6IetR/7rMmPxsAopAzcq5BV0kq9sd/JUipY1RgE X-Received: by 2002:a65:611a:: with SMTP id z26-v6mr2831927pgu.61.1528992982563; Thu, 14 Jun 2018 09:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528992982; cv=none; d=google.com; s=arc-20160816; b=DOYU+CIYdpJORprgCPLKGjNAvBYMDPOxaH4AWlcAC9ziopEeccmCNiiOlOHeW9/I0e TTJFUdH4tcjJs30g885F9R/jtiMdREEfSjrw6XJ8Mfc5RMkLVYLTTWF4Dm/tFp9nQ4Yv rIxKrXyhZyWimd2u3Pcg0wWilUuYi4AP3P3/EVAFsLwhYstRyT2g2/v6rCsjAV1J8C0+ P/pwuCkehNy3H2iSdJl48jEttuh5zR3xrrt/UWOsbwMwQbyL10X4RdnRsb4AY4g0Kx97 ljIYCQWGFt0HuAwO2irv5S6eEHEM+M6ySFgQaJejbH5J6M6LKTYV5Hm9G+R3pXMgc7U8 R1hg== 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=oedOx+/8ao1LlUi0k1oMe0CSsZX5hAHfQ9Rj6dDqAeQCGeRJpw5qRpHnL/MuxPprrE GaUd/pAUrhdTwJvtQPYF2phT92u7HzZ4D3pykUc3UuKGcD+ruRgOcGa9FvDFbfv1PEhI 0tpCjVc+uX4k/d3JYoJ3VsG7AHikFifxkV4DpDEMGzgWQoqigAAAxgl7AMRf3ARj2jgd /jEpu0FZr9WGdUufbLAMHRiYNXq4u+ssjPiKtgkgYxkwsGnT2VryjL9cNBJTXOx3aJQT Ga2rwubUgcWlcrw8wVRRthbuNthsq8UiPa2dNzsC01t6Pp9eo0W2eIyTdKhNN8c3BJR4 86aw== 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 y20-v6si5465686plr.55.2018.06.14.09.16.08; Thu, 14 Jun 2018 09:16:22 -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 S1755527AbeFNQJd (ORCPT + 99 others); Thu, 14 Jun 2018 12:09:33 -0400 Received: from osg.samsung.com ([64.30.133.232]:43890 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755243AbeFNQJ3 (ORCPT ); Thu, 14 Jun 2018 12:09:29 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 24A5A20F17; Thu, 14 Jun 2018 09:09:29 -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 W_mk4Lniad5y; Thu, 14 Jun 2018 09:09:28 -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 9515A20EA8; Thu, 14 Jun 2018 09:09:16 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.91) (envelope-from ) id 1fTUoE-0005TB-7T; Thu, 14 Jun 2018 13:09:14 -0300 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH v3 14/27] scripts/documentation-file-ref-check: get rid of false-positives Date: Thu, 14 Jun 2018 13:08:59 -0300 Message-Id: <3a5376cd3cd95b8c72fcdeb4dba4b83354f215d4.1528990947.git.mchehab+samsung@kernel.org> 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