-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
D417 Argument descriptions only required if there is an "Args" section #2310
Comments
I kept focusing in on the line with the actual argument instead of the "Parameters" heading. The most helpful thing for me, being new to both ruff and pydocstyle, would be if it told me that I didn't even have a section called "Args". But most confusing was when it didn't raise any error at all. So even if it just raised the generic |
Yeah "Parameters" isn't a respected Google-style heading, so it basically ignores it. I believe I think either One thing we could do to make this clearer is warn when you use a heading that isn't in the list of valid Google section names (assuming you have [
"Args",
"Arguments",
"Attention",
"Attributes",
"Caution",
"Danger",
"Error",
"Example",
"Examples",
"Hint",
"Important",
"Keyword Args",
"Keyword Arguments",
"Methods",
"Note",
"Notes",
"Return",
"Returns",
"Raises",
"References",
"See Also",
"Tip",
"Todo",
"Warning",
"Warnings",
"Warns",
"Yield",
"Yields",
] |
Warning about an incorrect heading would be awesome. What is the expected behavior if there is no heading at all (when we want to see D417 errors)? |
Yeah we could easily do this. It might need to be marked as an explicitly-enabled rule though, and not something that's automatically enabled as part of the
I think if you omit that section, there's no way to enforce that the errors are present. I think that's consistent with I want to implement |
Agreed; also, it won't catch misspellings / typos / etc. like if the section is headed Now that pydocstyle seems to be deprecated in favor of this project, are all the components related to it being maintained directly here? |
Encountered this issue too because I was missing an |
This might need to be a new rule, like: you're missing a required section. |
I would also be fine with a new rule for this, see #11435 which is related. |
Expected the code snippet below to show D417. That is, expected it to tell me that the "name" argument does not have a description in the docstring. If I change the word "Parameters" to "Args", then it will raise D417 as desired. Not sure if this is expected behavior, but it has been challenging to figure out.
Version: ruff 0.0.237
Code:
Command:
Output:
pyproject.toml:
The text was updated successfully, but these errors were encountered: