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:
Alan Du 2023-11-10 13:47:37 -05:00 committed by GitHub
parent 3e00ddce38
commit 5a1a8bebca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 182 additions and 7 deletions

View file

@ -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""#,