diff --git a/numpydoc/tests/hooks/example_module.py b/numpydoc/tests/hooks/example_module.py index 87e9b52d..9f75bdf0 100644 --- a/numpydoc/tests/hooks/example_module.py +++ b/numpydoc/tests/hooks/example_module.py @@ -23,8 +23,8 @@ def do_something(self, *args, **kwargs): *args """ - def process(self): - """Process stuff.""" + def create(self): + """Creates stuff.""" class NewClass: diff --git a/numpydoc/tests/hooks/test_validate_hook.py b/numpydoc/tests/hooks/test_validate_hook.py index 25851db5..47f315c2 100644 --- a/numpydoc/tests/hooks/test_validate_hook.py +++ b/numpydoc/tests/hooks/test_validate_hook.py @@ -116,9 +116,7 @@ def test_validate_hook_with_toml_config(example_module, tmp_path, capsys): ] exclude = '\\.__init__$' override_SS05 = [ - '^Process', - '^Assess', - '^Access', + '^Creates', ] """ ) @@ -154,7 +152,7 @@ def test_validate_hook_with_setup_cfg(example_module, tmp_path, capsys): [tool:numpydoc_validation] checks = all,EX01,SA01,ES01 exclude = \\.__init__$ - override_SS05 = ^Process,^Assess,^Access + override_SS05 = ^Creates """ ) ) @@ -198,9 +196,7 @@ def test_validate_hook_exclude_option_pyproject(example_module, tmp_path, capsys '\.__init__$', ] override_SS05 = [ - '^Process', - '^Assess', - '^Access', + '^Creates', ] """ ) @@ -232,7 +228,7 @@ def test_validate_hook_exclude_option_setup_cfg(example_module, tmp_path, capsys [tool:numpydoc_validation] checks = all,EX01,SA01,ES01 exclude = \\.NewClass$,\\.__init__$ - override_SS05 = ^Process,^Assess,^Access + override_SS05 = ^Creates """ ) ) diff --git a/numpydoc/validate.py b/numpydoc/validate.py index db605949..d0debfa2 100644 --- a/numpydoc/validate.py +++ b/numpydoc/validate.py @@ -710,7 +710,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"))