From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> To: Linux Doc Mailing List <linux-doc@vger.kernel.org> Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>, Mauro Carvalho Chehab <mchehab@infradead.org>, linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net> Subject: [PATCH v3 14/27] scripts/documentation-file-ref-check: get rid of false-positives Date: Thu, 14 Jun 2018 13:08:59 -0300 [thread overview] Message-ID: <3a5376cd3cd95b8c72fcdeb4dba4b83354f215d4.1528990947.git.mchehab+samsung@kernel.org> (raw) In-Reply-To: <cover.1528990947.git.mchehab+samsung@kernel.org> In-Reply-To: <cover.1528990947.git.mchehab+samsung@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 <mchehab+samsung@kernel.org> --- 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 (<IN>) { 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
WARNING: multiple messages have this Message-ID (diff)
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> To: Linux Doc Mailing List <linux-doc@vger.kernel.org> Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>, Mauro Carvalho Chehab <mchehab@infradead.org>, linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net> Subject: [PATCH v3 14/27] scripts/documentation-file-ref-check: get rid of false-positives Date: Thu, 14 Jun 2018 13:08:59 -0300 [thread overview] Message-ID: <3a5376cd3cd95b8c72fcdeb4dba4b83354f215d4.1528990947.git.mchehab+samsung@kernel.org> (raw) In-Reply-To: <cover.1528990947.git.mchehab+samsung@kernel.org> In-Reply-To: <cover.1528990947.git.mchehab+samsung@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 <mchehab+samsung@kernel.org> --- 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 (<IN>) { 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 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-06-14 16:14 UTC|newest] Thread overview: 161+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-06-14 16:08 [PATCH v3 00/27] Fix some doc build warnings/errors and broken links Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 01/27] docs: can.rst: fix a footnote reference Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 02/27] docs: crypto_engine.rst: Fix two parse warnings Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 03/27] arch/*: Kconfig: fix documentation for NMI watchdog Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 04/27] docs: fix broken references with multiple hints Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [v3,04/27] " Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 04/27] " Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:27 ` Steven Rostedt 2018-06-14 16:27 ` Steven Rostedt 2018-06-14 16:27 ` Steven Rostedt 2018-06-14 16:27 ` [v3,04/27] " Steven Rostedt 2018-06-14 16:27 ` [PATCH v3 04/27] " Steven Rostedt 2018-06-14 16:27 ` Steven Rostedt 2018-06-14 16:08 ` [PATCH v3 05/27] docs: Fix some broken references Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [v3,05/27] " Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 05/27] " Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-15 9:05 ` Coly Li 2018-06-15 9:05 ` Coly Li 2018-06-15 9:05 ` Coly Li 2018-06-15 9:05 ` [v3,05/27] " Coly Li 2018-06-15 9:05 ` [PATCH v3 05/27] " Coly Li 2018-06-15 9:05 ` Coly Li 2018-06-15 9:05 ` Coly Li 2018-06-14 16:08 ` [PATCH v3 06/27] media: dvb: fix location of get_dvb_firmware script Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 07/27] media: dvb: point to the location of the old README.dvb-usb file Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 08/27] media: v4l: fix broken video4linux docs locations Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 09/27] media: max2175: fix location of driver's companion documentation Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 10/27] scripts/documentation-file-ref-check: fix help message Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 11/27] scripts/documentation-file-ref-check: accept more wildcards at filenames Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 12/27] scripts/documentation-file-ref-check: add a fix logic for DT Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` [PATCH v3 13/27] scripts/documentation-file-ref-check: hint: dash or underline Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab 2018-06-14 16:08 ` Mauro Carvalho Chehab [this message] 2018-06-14 16:08 ` [PATCH v3 14/27] scripts/documentation-file-ref-check: get rid of false-positives Mauro Carvalho Chehab 2018-06-14 16:09 ` [PATCH v3 15/27] scripts/documentation-file-ref-check: check tools/*/Documentation Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` [PATCH v3 16/27] docs: Fix more broken references Mauro Carvalho Chehab 2018-06-14 16:09 ` [Intel-wired-lan] " Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` [v3,16/27] " Mauro Carvalho Chehab 2018-06-14 16:09 ` [PATCH v3 16/27] " Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:22 ` Guenter Roeck 2018-06-14 16:22 ` [Intel-wired-lan] " Guenter Roeck 2018-06-14 16:22 ` Guenter Roeck 2018-06-14 16:22 ` [v3,16/27] " Guenter Roeck 2018-06-14 16:22 ` [PATCH v3 16/27] " Guenter Roeck 2018-06-14 16:22 ` Guenter Roeck 2018-06-14 16:28 ` [Intel-wired-lan] " Jeff Kirsher 2018-06-14 16:28 ` Jeff Kirsher 2018-06-14 16:28 ` Jeff Kirsher 2018-06-14 16:28 ` [v3,16/27] " Jeff Kirsher 2018-06-14 16:28 ` [Intel-wired-lan] [PATCH v3 16/27] " Jeff Kirsher 2018-06-14 16:29 ` [alsa-devel] " Takashi Iwai 2018-06-14 16:29 ` [Intel-wired-lan] " Takashi Iwai 2018-06-14 16:29 ` Takashi Iwai 2018-06-14 16:29 ` [v3,16/27] " Takashi Iwai 2018-06-14 16:29 ` [alsa-devel] [PATCH v3 16/27] " Takashi Iwai 2018-06-14 16:29 ` Takashi Iwai 2018-06-15 8:46 ` Matthias Brugger 2018-06-15 8:46 ` [Intel-wired-lan] " Matthias Brugger 2018-06-15 8:46 ` Matthias Brugger 2018-06-15 8:46 ` [v3,16/27] " Matthias Brugger 2018-06-15 8:46 ` [PATCH v3 16/27] " Matthias Brugger 2018-06-15 8:46 ` Matthias Brugger 2018-06-15 21:42 ` Stephen Boyd 2018-06-15 21:42 ` [Intel-wired-lan] " Stephen Boyd 2018-06-15 21:42 ` Stephen Boyd 2018-06-15 21:42 ` [v3,16/27] " Stephen Boyd 2018-06-15 21:42 ` [PATCH v3 16/27] " Stephen Boyd 2018-06-15 21:42 ` Stephen Boyd 2018-06-15 21:42 ` Stephen Boyd 2018-06-15 21:42 ` Stephen Boyd 2018-06-14 16:09 ` [PATCH v3 17/27] bindings: nvmem/zii: Fix location of nvmem.txt Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:52 ` Srinivas Kandagatla 2018-06-14 16:52 ` Srinivas Kandagatla 2018-06-14 16:09 ` [PATCH v3 18/27] kernel-parameters.txt: fix pointers to sound parameters Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` [PATCH v3 19/27] MAINTAINERS: fix location of some display DT bindings Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` [PATCH v3 20/27] MAINTAINERS: fix location of DT npcm files Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` [PATCH v3 21/27] MAINTAINERS: get rid of non-existing Documentation/fpga Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:39 ` Alan Tull 2018-06-14 16:39 ` Alan Tull 2018-06-14 16:52 ` Mauro Carvalho Chehab 2018-06-14 16:52 ` Mauro Carvalho Chehab 2018-06-14 18:09 ` Alan Tull 2018-06-14 18:09 ` Alan Tull 2018-06-14 16:09 ` [PATCH v3 22/27] devicetree: fix some bindings file names Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` [PATCH v3 23/27] devicetree: fix name of pinctrl-bindings.txt Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-26 9:33 ` Linus Walleij 2018-06-26 9:33 ` Linus Walleij 2018-06-26 9:33 ` Linus Walleij 2018-07-03 7:33 ` Lee Jones 2018-07-03 7:33 ` Lee Jones 2018-06-14 16:09 ` [PATCH v3 24/27] devicetree: fix a series of wrong file references Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-18 7:57 ` Alexandre Torgue 2018-06-18 7:57 ` Alexandre Torgue 2018-06-18 7:57 ` Alexandre Torgue 2018-06-18 7:57 ` Alexandre Torgue 2018-06-18 7:57 ` Alexandre Torgue 2018-06-20 0:42 ` Chen-Yu Tsai 2018-06-20 0:42 ` Chen-Yu Tsai 2018-06-20 0:42 ` Chen-Yu Tsai 2018-06-20 0:42 ` Chen-Yu Tsai 2018-06-20 0:42 ` Chen-Yu Tsai 2018-07-03 7:34 ` Lee Jones 2018-07-03 7:34 ` Lee Jones 2018-07-03 7:34 ` Lee Jones 2018-07-03 7:34 ` Lee Jones 2018-07-03 7:34 ` Lee Jones 2018-06-14 16:09 ` [PATCH v3 25/27] ABI: sysfs-devices-system-cpu: remove a broken reference Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` [PATCH v3 26/27] Documentation: rstFlatTable.py: fix " Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 [v3,27/27] fix a series of Documentation/ broken file name references Mauro Carvalho Chehab 2018-06-14 16:09 ` [PATCH v3 27/27] " Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:09 ` Mauro Carvalho Chehab 2018-06-14 16:18 [v3,27/27] " Rafael J. Wysocki 2018-06-14 16:18 ` [PATCH v3 27/27] " Rafael J. Wysocki 2018-06-14 16:18 ` Rafael J. Wysocki 2018-06-14 16:18 ` Rafael J. Wysocki 2018-06-14 16:18 ` Rafael J. Wysocki 2018-06-14 17:21 [v3,27/27] " Andy Shevchenko 2018-06-14 17:21 ` [PATCH v3 27/27] " Andy Shevchenko 2018-06-14 17:21 ` Andy Shevchenko 2018-06-14 17:21 ` Andy Shevchenko 2018-06-14 17:21 ` Andy Shevchenko
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=3a5376cd3cd95b8c72fcdeb4dba4b83354f215d4.1528990947.git.mchehab+samsung@kernel.org \ --to=mchehab+samsung@kernel.org \ --cc=corbet@lwn.net \ --cc=linux-doc@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mchehab@infradead.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.