Skip to content

Commit 00854d5

Browse files
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 <[email protected]>
1 parent 5339b68 commit 00854d5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

doc/validation.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ a more detailed message. For example::
6464
The full mapping of validation checks is given below.
6565

6666
.. literalinclude:: ../numpydoc/validate.py
67-
:lines: 36-90
67+
:start-after: start-err-msg
68+
:end-before: end-err-msg

numpydoc/validate.py

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
"References",
3535
"Examples",
3636
]
37+
# NOTE: The following comment is a sentinel for embedding in the docs - do not
38+
# modify/remove
39+
# start-err-msg
3740
ERROR_MSGS = {
3841
"GL01": "Docstring text (summary) should start in the line immediately "
3942
"after the opening quotes (not in the same line, or leaving a "
@@ -91,6 +94,9 @@
9194
"SA04": 'Missing description for See Also "{reference_name}" reference',
9295
"EX01": "No examples section found",
9396
}
97+
# end-err-msg
98+
# NOTE: The above comment is a sentinel for embedding in the docs - do not
99+
# modify/remove
94100

95101
# Ignore these when evaluating end-of-line-"." checks
96102
IGNORE_STARTS = (" ", "* ", "- ")

0 commit comments

Comments
 (0)