add a dummy builder, for syntax checkers

This commit is contained in:
Buck Golemon 2015-06-23 11:59:22 -07:00
parent 27be6614f7
commit 59dfb47c1c
4 changed files with 50 additions and 0 deletions

View File

@ -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

View File

@ -6,6 +6,7 @@ Incompatible changes
Features added
--------------
* Added the ``dummy`` builder: syntax check without output.
Bugs fixed
----------

View File

@ -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

36
sphinx/builders/dummy.py Normal file
View File

@ -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