Skip to content

Commit

Permalink
docs: fix validation include line numbers (#418)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
thatlittleboy and rossbar committed Jul 18, 2022
1 parent 5339b68 commit 00854d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion doc/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions numpydoc/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
"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 "
Expand Down Expand Up @@ -91,6 +94,9 @@
"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 = (" ", "* ", "- ")
Expand Down

0 comments on commit 00854d5

Please sign in to comment.