Skip to content

Commit 4d0f088

Browse files
committed
BUG: Correct functionality of numpydoc SS05.
Currently SS05 checks for infinitive verbs by checking if the last character is "s". However, if the first word is "process", which is valid, this incorrectly throws a numpydoc validation error. This commit allows the first word to end in two "s"es without flagging as an error. This will allow for words like "process" or "progress," while still checking for invalid words like "creates."
1 parent a36287a commit 4d0f088

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

numpydoc/validate.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,12 @@ def validate(obj_name, validator_cls=None, **validator_kwargs):
711711
errs.append(error("SS03"))
712712
if doc.summary != doc.summary.lstrip():
713713
errs.append(error("SS04"))
714-
elif doc.is_function_or_method and doc.summary.split(" ")[0][-1] == "s":
714+
# Heuristic to check for infinitive verbs - shouldn't end in "s"
715+
elif (
716+
doc.is_function_or_method
717+
and doc.summary.split(" ")[0][-1] == "s"
718+
and doc.summary.split(" ")[0][-2] != "s"
719+
):
715720
errs.append(error("SS05"))
716721
if doc.num_summary_lines > 1:
717722
errs.append(error("SS06"))

0 commit comments

Comments
 (0)