mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-08 19:41:14 +00:00
[pydoclint
] Implement docstring-missing-exception
and docstring-extraneous-exception
(DOC501
, DOC502
) (#11471)
## Summary These are the first rules implemented as part of #458, but I plan to implement more. Specifically, this implements `docstring-missing-exception` which checks for raised exceptions not documented in the docstring, and `docstring-extraneous-exception` which checks for exceptions in the docstring not present in the body. ## Test Plan Test fixtures added for both google and numpy style.
This commit is contained in:
parent
53b84ab054
commit
4bc73dd87e
21 changed files with 1161 additions and 67 deletions
|
@ -48,7 +48,7 @@ mod tests {
|
|||
let snapshot = format!("{}_{}", rule_code.as_ref(), path.to_string_lossy());
|
||||
let diagnostics = test_path(
|
||||
Path::new("%s").join(path).as_path(),
|
||||
&settings::Settings::for_rule(rule_code),
|
||||
&settings::LinterSettings::for_rule(rule_code),
|
||||
)?;
|
||||
assert_messages!(snapshot, diagnostics);
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue