mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00
Allow overriding pydocstyle convention rules (#8586)
## Summary This fixes #2606 by moving where we apply the convention ignores -- instead of applying that at the very end, e track, we now track which rules have been specifically enabled (via `Specificity::Rule`). If they have, then we do *not* apply the docstring overrides at the end. ## Test Plan Added unit tests to `ruff_workspace` and an integration test to `ruff_cli`
This commit is contained in:
parent
3e00ddce38
commit
5a1a8bebca
4 changed files with 182 additions and 7 deletions
|
@ -2405,9 +2405,18 @@ pub struct PydocstyleOptions {
|
|||
/// convention = "google"
|
||||
/// ```
|
||||
///
|
||||
/// As conventions force-disable all rules not included in the convention,
|
||||
/// enabling _additional_ rules on top of a convention is currently
|
||||
/// unsupported.
|
||||
/// To modify a convention (i.e., to enable an additional rule that's excluded
|
||||
/// from the convention by default), select the desired rule via its fully
|
||||
/// qualified rule code (e.g., `D400` instead of `D4` or `D40`):
|
||||
///
|
||||
/// ```toml
|
||||
/// [tool.ruff.lint]
|
||||
/// # Enable D400 on top of the Google convention.
|
||||
/// extend-select = ["D400"]
|
||||
///
|
||||
/// [tool.ruff.lint.pydocstyle]
|
||||
/// convention = "google"
|
||||
/// ```
|
||||
#[option(
|
||||
default = r#"null"#,
|
||||
value_type = r#""google" | "numpy" | "pep257""#,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue