summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Goh <30731072+thatlittleboy@users.noreply.github.com>2022-07-18 21:26:44 +0800
committerGitHub <noreply@github.com>2022-07-18 09:26:44 -0400
commit00854d5a438905fae46a6bed3db12cd505bb92e5 (patch)
tree9bfe82b62f02e6b5b7051f3addc5203e70b8d91a
parent5339b68da8bb5ae700400ee60d5004f270876b5a (diff)
downloadnumpydoc-00854d5a438905fae46a6bed3db12cd505bb92e5.tar.gz
docs: fix validation include line numbers (#418)
* docs: fix validation include line numbers * use start/end markers instead of hardcoding lineno * Add missing sentinel + explanatory comment. Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
-rw-r--r--doc/validation.rst3
-rw-r--r--numpydoc/validate.py6
2 files changed, 8 insertions, 1 deletions
diff --git a/doc/validation.rst b/doc/validation.rst
index 8235559..ee6e08d 100644
--- a/doc/validation.rst
+++ b/doc/validation.rst
@@ -64,4 +64,5 @@ a more detailed message. For example::
The full mapping of validation checks is given below.
.. literalinclude:: ../numpydoc/validate.py
- :lines: 36-90
+ :start-after: start-err-msg
+ :end-before: end-err-msg
diff --git a/numpydoc/validate.py b/numpydoc/validate.py
index 780d895..4a323b9 100644
--- a/numpydoc/validate.py
+++ b/numpydoc/validate.py
@@ -34,6 +34,9 @@ ALLOWED_SECTIONS = [
"References",
"Examples",
]
+# NOTE: The following comment is a sentinel for embedding in the docs - do not
+# modify/remove
+# start-err-msg
ERROR_MSGS = {
"GL01": "Docstring text (summary) should start in the line immediately "
"after the opening quotes (not in the same line, or leaving a "
@@ -91,6 +94,9 @@ ERROR_MSGS = {
"SA04": 'Missing description for See Also "{reference_name}" reference',
"EX01": "No examples section found",
}
+# end-err-msg
+# NOTE: The above comment is a sentinel for embedding in the docs - do not
+# modify/remove
# Ignore these when evaluating end-of-line-"." checks
IGNORE_STARTS = (" ", "* ", "- ")