diff options
author | Linus Torvalds | 2019-05-08 21:42:50 +0200 |
---|---|---|
committer | Linus Torvalds | 2019-05-08 21:42:50 +0200 |
commit | 8c79f4cd441b27df6cadd11b70a50e06b3b3a2bf (patch) | |
tree | 0d7fca2a5fb43fa75b51c4cdaaee493e44d56d62 /scripts/documentation-file-ref-check | |
parent | Merge tag 'kbuild-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/masa... (diff) | |
parent | docs/livepatch: Unify style of livepatch documentation in the ReST format (diff) | |
download | kernel-qcow2-linux-8c79f4cd441b27df6cadd11b70a50e06b3b3a2bf.tar.gz kernel-qcow2-linux-8c79f4cd441b27df6cadd11b70a50e06b3b3a2bf.tar.xz kernel-qcow2-linux-8c79f4cd441b27df6cadd11b70a50e06b3b3a2bf.zip |
Merge tag 'docs-5.2' of git://git.lwn.net/linux
Pull documentation updates from Jonathan Corbet:
"A reasonably busy cycle for docs, including:
- Lots of work on the Chinese and Italian translations
- Some license-rules clarifications from Christoph
- Various build-script fixes
- A new document on memory models
- RST conversion of the live-patching docs
- The usual collection of typo fixes and corrections"
* tag 'docs-5.2' of git://git.lwn.net/linux: (140 commits)
docs/livepatch: Unify style of livepatch documentation in the ReST format
docs: livepatch: convert docs to ReST and rename to *.rst
scripts/documentation-file-ref-check: detect broken :doc:`foo`
scripts/documentation-file-ref-check: don't parse Next/ dir
LICENSES: Rename other to deprecated
LICENSES: Clearly mark dual license only licenses
docs: Don't reference the ZLib license in license-rules.rst
docs/vm: Minor editorial changes in the THP and hugetlbfs
docs/vm: add documentation of memory models
doc:it_IT: translation alignment
doc: fix typo in PGP guide
dontdiff: update with Kconfig build artifacts
docs/zh_CN: fix typos in 1.Intro.rst file
docs/zh_CN: redirect CoC docs to Chinese version
doc: mm: migration doesn't use FOLL_SPLIT anymore
docs: doc-guide: remove the extension from .rst files
doc: kselftest: Fix KBUILD_OUTPUT usage instructions
docs: trace: fix some Sphinx warnings
docs: speculation.txt: mark example blocks as such
docs: ntb.txt: add blank lines to clean up some Sphinx warnings
...
Diffstat (limited to 'scripts/documentation-file-ref-check')
-rwxr-xr-x | scripts/documentation-file-ref-check | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check index ad9db6821824..63e9542656f1 100755 --- a/scripts/documentation-file-ref-check +++ b/scripts/documentation-file-ref-check @@ -30,6 +30,34 @@ print "Finding broken references. This may take a while... " if ($fix); my %broken_ref; +my $doc_fix = 0; + +open IN, "git grep ':doc:\`' Documentation/|" + or die "Failed to run git grep"; +while (<IN>) { + next if (!m,^([^:]+):.*\:doc\:\`([^\`]+)\`,); + + my $d = $1; + my $doc_ref = $2; + + my $f = $doc_ref; + + $d =~ s,(.*/).*,$1,; + $f =~ s,.*\<([^\>]+)\>,$1,; + + $f ="$d$f.rst"; + + next if (grep -e, glob("$f")); + + if ($fix && !$doc_fix) { + print STDERR "\nWARNING: Currently, can't fix broken :doc:`` fields\n"; + } + $doc_fix++; + + print STDERR "$f: :doc:`$doc_ref`\n"; +} +close IN; + open IN, "git grep 'Documentation/'|" or die "Failed to run git grep"; while (<IN>) { @@ -38,6 +66,9 @@ while (<IN>) { my $f = $1; my $ln = $2; + # On linux-next, discard the Next/ directory + next if ($f =~ m,^Next/,); + # Makefiles and scripts contain nasty expressions to parse docs next if ($f =~ m/Makefile/ || $f =~ m/\.sh$/); @@ -100,6 +131,7 @@ while (<IN>) { } } } +close IN; exit 0 if (!$fix); |