Clarify that D417 only checks docstrings with an arguments section (#16494)

## Summary

This came up in https://github.com/astral-sh/ruff/issues/16477

It's not obvious from the D417 rule's documentation that it only checks
docstrings
with an arguments section. Functions without such a section aren't
checked.

This PR tries to make this clearer in the documentation.
This commit is contained in:
Micha Reiser
2025-03-06 09:49:35 +00:00
committed by GitHub
parent ce0018c3cb
commit a25be4610a

View File

@@ -1167,6 +1167,7 @@ impl AlwaysFixableViolation for MissingSectionNameColon {
/// a blank line, followed by a series of sections, each with a section header
/// and a section body. Function docstrings often include a section for
/// function arguments; this rule is concerned with that section only.
/// Note that this rule only checks docstrings with an arguments (e.g. `Args`) section.
///
/// This rule is enabled when using the `google` convention, and disabled when
/// using the `pep257` and `numpy` conventions.