Skip to content

Commit

Permalink
set up tox to run docs build with checker enabled
Browse files Browse the repository at this point in the history
Use an environment variable to control when the extension is enabled
in conf.py.

Add settings to setup.cfg to control the build.

Add tox environment 'docs' to build HTML docs and then run spell
check.

Update the word list with more words that are used and should not
trigger a build failure.

Change-Id: I19b7e2134eb7961f9817fadf30de57ed82b855ef
Signed-off-by: Doug Hellmann <[email protected]>
  • Loading branch information
dhellmann committed Sep 27, 2017
1 parent dfe5cda commit 5a8e3ce
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
#
# CANNOT ENABLE SPHINXCONTRIB.SPELLING because ReadTheDocs.org does not support
# PyEnchant.
#extensions = [ 'sphinxcontrib.spelling' ]
extensions = []
if os.getenv('ENABLE_SPELLING'):
extensions.append('sphinxcontrib.spelling')

spelling_show_suggestions = True
spelling_ignore_pypi_package_names = True
Expand Down
7 changes: 7 additions & 0 deletions docs/source/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
builtins
reStructuredText
sphinxcontrib
tokenizer
txt
wikis
wordlist
Minhee
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ namespace_packages =

[aliases]
release = egg_info -RDb ''

[build_sphinx]
all-files = 1
warning-is-error = 1
source-dir = docs/source
build-dir = docs/build
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ commands=
[testenv:pep8]
deps=flake8
commands=flake8 sphinxcontrib setup.py

[testenv:docs]
setenv =
ENABLE_SPELLING=1
commands =
python setup.py build_sphinx
sphinx-build -b spelling docs/source docs/build

0 comments on commit 5a8e3ce

Please sign in to comment.