summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 e8051429f..681ff014b 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 bc328a833..2877569b0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -20,6 +20,7 @@ Incompatible changes
Features added
--------------
+* Added the ``dummy`` builder: syntax check without output.
* #2092: add todo directive support in napoleon package.
* #1962: when adding directives, roles or nodes from an extension, warn if such
diff --git a/doc/builders.rst b/doc/builders.rst
index 93e01e4b7..85475ab1e 100644
--- a/doc/builders.rst
+++ b/doc/builders.rst
@@ -341,6 +341,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