summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-11-11 06:15:16 -0500
committerNed Batchelder <ned@nedbatchelder.com>2019-11-11 07:14:56 -0500
commit2cabc80a24e5f1b24e1eea1c39407c3aa60eee9e (patch)
treed3f0d5c5eb4900637ed80fe021edb1d19daf6c4b
parent12ebfecd95995300caf7cd268bfd96e826552c05 (diff)
downloadpython-coveragepy-git-2cabc80a24e5f1b24e1eea1c39407c3aa60eee9e.tar.gz
Better auto-spelling of contributors' names
-rw-r--r--MANIFEST.in1
-rw-r--r--doc/conf.py20
-rw-r--r--igor.py3
-rw-r--r--tox.ini2
4 files changed, 17 insertions, 9 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index 7a84cf20..75257c60 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -37,6 +37,7 @@ recursive-include coverage/ctracer *.c *.h
recursive-include doc *.py *.pip *.rst *.txt *.png
recursive-include doc/_static *
prune doc/_build
+prune doc/_spell
recursive-include requirements *.pip
diff --git a/doc/conf.py b/doc/conf.py
index ea00b6ce..379e15cc 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -17,6 +17,8 @@
import atexit
import os
+import re
+import sys
import tempfile
# If extensions (or modules to document with autodoc) are in another directory,
@@ -189,14 +191,18 @@ htmlhelp_basename = 'coveragepydoc'
# -- Spelling ---
-names_file = tempfile.NamedTemporaryFile(mode='w', prefix="coverage_names_", suffix=".txt")
-with open("../CONTRIBUTORS.txt") as contributors:
- names_file.write("\n".join(contributors.read().split()))
- names_file.flush()
-atexit.register(os.remove, names_file.name)
+if any("spell" in arg for arg in sys.argv):
+ names_file = tempfile.NamedTemporaryFile(mode='w', prefix="coverage_names_", suffix=".txt")
+ with open("../CONTRIBUTORS.txt") as contributors:
+ names = set(re.split(r"[^\w']", contributors.read()))
+ names = [n for n in names if len(n) >= 2 and n[0].isupper()]
+ names_file.write("\n".join(names))
+ names_file.flush()
+ atexit.register(os.remove, names_file.name)
+
+ spelling_word_list_filename = ['dict.txt', names_file.name]
+ spelling_show_suggestions = False
-spelling_word_list_filename = ['dict.txt', names_file.name]
-spelling_show_suggestions = False
extlinks = {
# :github:`123` becomes a link to the GitHub issue, with text "issue 123".
diff --git a/igor.py b/igor.py
index 0c550dfb..3850ce76 100644
--- a/igor.py
+++ b/igor.py
@@ -249,6 +249,7 @@ def do_check_eol():
'.tox*',
'*.egg-info',
'_build',
+ '_spell',
]
checked = set()
@@ -296,7 +297,7 @@ def do_check_eol():
check_files("coverage", ["*.py"])
check_files("coverage/ctracer", ["*.c", "*.h"])
- check_files("coverage/htmlfiles", ["*.html", "*.css", "*.js"])
+ check_files("coverage/htmlfiles", ["*.html", "*.scss", "*.css", "*.js"])
check_files("tests", ["*.py"])
check_files("tests", ["*,cover"], trail_white=False)
check_files("tests/js", ["*.js", "*.html"])
diff --git a/tox.ini b/tox.ini
index 935c88dd..78eb44ab 100644
--- a/tox.ini
+++ b/tox.ini
@@ -55,7 +55,7 @@ deps =
-r doc/requirements.pip
commands =
python doc/check_copied_from.py doc/*.rst
- doc8 -q --ignore-path doc/_build doc CHANGES.rst README.rst
+ doc8 -q --ignore-path 'doc/_*' doc CHANGES.rst README.rst
sphinx-build -b html -aqE doc doc/_build/html
rst2html.py --strict README.rst doc/_build/trash
sphinx-build -b html -b linkcheck -aEnq doc doc/_build/html