summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBuck Golemon <buck@yelp.com>2015-06-23 11:59:22 -0700
committerBuck Golemon <buck@yelp.com>2015-06-23 16:23:27 -0700
commit59dfb47c1ce5fc2541380dfe00ee53fb56e53a54 (patch)
treef678479642882d660de5f1f117355491e833bc51
parent27be6614f77f99a5d5d633903f306920413c5bc8 (diff)
downloadsphinx-git-59dfb47c1ce5fc2541380dfe00ee53fb56e53a54.tar.gz
add a dummy builder, for syntax checkers
-rw-r--r--AUTHORS1
-rw-r--r--CHANGES1
-rw-r--r--doc/builders.rst12
-rw-r--r--sphinx/builders/dummy.py36
4 files changed, 50 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index 4574c3d8b..81a194995 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -24,6 +24,7 @@ Other contributors, listed alphabetically, are:
* Charles Duffy -- original graphviz extension
* Kevin Dunn -- MathJax extension
* Josip Dzolonga -- coverage builder
+* Buck Evan -- dummy builder
* Hernan Grecco -- search improvements
* Horst Gutmann -- internationalization support
* Martin Hans -- autodoc improvements
diff --git a/CHANGES b/CHANGES
index 9960eb772..589a9efbb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,7 @@ Incompatible changes
Features added
--------------
+* Added the ``dummy`` builder: syntax check without output.
Bugs fixed
----------
diff --git a/doc/builders.rst b/doc/builders.rst
index 4fbd5bae6..bc225c6f9 100644
--- a/doc/builders.rst
+++ b/doc/builders.rst
@@ -309,6 +309,18 @@ for details.
.. autoattribute:: supported_image_types
+.. module:: sphinx.builders.dummy
+.. class:: DummyBuilder
+
+ This builder produces no output. The input is only parsed and checked for
+ consistency. This is useful for linting purposes.
+
+ .. autoattribute:: name
+
+ .. autoattribute:: supported_image_types
+
+ .. versionadded:: 1.4
+
.. module:: sphinx.builders.linkcheck
.. class:: CheckExternalLinksBuilder
diff --git a/sphinx/builders/dummy.py b/sphinx/builders/dummy.py
new file mode 100644
index 000000000..edf43ab9d
--- /dev/null
+++ b/sphinx/builders/dummy.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+"""
+ sphinx.builders.dummy
+ ~~~~~~~~~~~~~~~~~~~~
+
+ Do syntax checks, but no writing.
+
+ :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+"""
+
+
+from sphinx.builders import Builder
+
+
+class DummyBuilder(Builder):
+ name = 'dummy'
+ allow_parallel = True
+
+ def init(self):
+ pass
+
+ def get_outdated_docs(self):
+ return self.env.found_docs
+
+ def get_target_uri(self, docname, typ=None):
+ return ''
+
+ def prepare_writing(self, docnames):
+ pass
+
+ def write_doc(self, docname, doctree):
+ pass
+
+ def finish(self):
+ pass