Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion numpydoc/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,13 @@ def validate(obj_name, validator_cls=None, **validator_kwargs):
errs.append(error("SS03"))
if doc.summary != doc.summary.lstrip():
errs.append(error("SS04"))
elif doc.is_function_or_method and doc.summary.split(" ")[0][-1] == "s":
# Heuristic to check for infinitive verbs - shouldn't end in "s"
elif (
doc.is_function_or_method
and len(doc.summary.split(" ")[0]) > 1
and doc.summary.split(" ")[0][-1] == "s"
and doc.summary.split(" ")[0][-2] != "s"
):
errs.append(error("SS05"))
if doc.num_summary_lines > 1:
errs.append(error("SS06"))
Expand Down
Loading