[PATCH] Docs: add 'lintdocs' target with basic sanity checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Heiser <markus.heiser@xxxxxxxxxxx>

The 'lintdocs' produces no output. The input is only parsed and checked for
consistency. This is useful for basic sanity checks [1].

The 'lintdocs' target uses Sphinx's 'dummy' builder. For this at least Sphinx
1.4 is needed [2]. Sphinx 1.4 is not always available in LTS distros, so here is
what I have done to build with up-to-date Sphinx::

  $ pip install --user sphinx
  $ make SPHINXBUILD=~/.local/bin/sphinx-build cleandocs lintdocs

The time-saving of the 'dummy' builder against the 'html' builder is about 40%.

[1] https://www.mail-archive.com/linux-doc@xxxxxxxxxxxxxxx/msg13244.html
[2] http://www.sphinx-doc.org/en/stable/builders.html#sphinx.builders.dummy.DummyBuilder

Signed-off-by: Markus Heiser <markus.heiser@xxxxxxxxxxx>
---
 Documentation/Makefile       | 3 +++
 Documentation/media/Makefile | 1 +
 Makefile                     | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index a423203..cf1da55 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -90,6 +90,9 @@ epubdocs:
 xmldocs:
 	@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,xml,$(var),xml,$(var)))
 
+lintdocs:
+	@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,dummy,$(var),xml,$(var)))
+
 endif # HAVE_SPHINX
 
 # The following targets are independent of HAVE_SPHINX, and the rules should
diff --git a/Documentation/media/Makefile b/Documentation/media/Makefile
index 3616695..b211edc 100644
--- a/Documentation/media/Makefile
+++ b/Documentation/media/Makefile
@@ -57,6 +57,7 @@ all: $(IMGDOT) $(BUILDDIR) ${TARGETS}
 html: all
 epub: all
 xml: all
+dummy: $(BUILDDIR) ${TARGETS}
 latex: $(IMGPDF) all
 linkcheck:
 
diff --git a/Makefile b/Makefile
index dd1eb8d..83e2368 100644
--- a/Makefile
+++ b/Makefile
@@ -1464,7 +1464,7 @@ $(help-board-dirs): help-%:
 
 # Documentation targets
 # ---------------------------------------------------------------------------
-DOC_TARGETS := xmldocs sgmldocs psdocs latexdocs pdfdocs htmldocs mandocs installmandocs epubdocs cleandocs linkcheckdocs
+DOC_TARGETS := xmldocs sgmldocs psdocs latexdocs pdfdocs htmldocs mandocs installmandocs epubdocs cleandocs linkcheckdocs lintdocs
 PHONY += $(DOC_TARGETS)
 $(DOC_TARGETS): scripts_basic FORCE
 	$(Q)$(MAKE) $(build)=Documentation $@
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux