Document the way extend-ignore/select are applied (#1839)

Closes: https://github.com/charliermarsh/ruff/issues/1838
This commit is contained in:
Jan Katins
2023-01-13 01:44:03 +01:00
committed by GitHub
parent 9aeb5df5fe
commit ef17c82998
3 changed files with 26 additions and 2 deletions

View File

@@ -143,6 +143,12 @@ pub struct Options {
)]
/// A list of rule codes or prefixes to ignore, in addition to those
/// specified by `ignore`.
///
/// Note that `extend-ignore` is applied after resolving rules from
/// `ignore`/`select` and a less specific rule in `extend-ignore`
/// would overwrite a more specific rule in `select`. It is
/// recommended to only use `extend-ignore` when extending a
/// `pyproject.toml` file via `extend`.
pub extend_ignore: Option<Vec<RuleCodePrefix>>,
#[option(
default = "[]",
@@ -154,6 +160,12 @@ pub struct Options {
)]
/// A list of rule codes or prefixes to enable, in addition to those
/// specified by `select`.
///
/// Note that `extend-select` is applied after resolving rules from
/// `ignore`/`select` and a less specific rule in `extend-select`
/// would overwrite a more specific rule in `ignore`. It is
/// recommended to only use `extend-select` when extending a
/// `pyproject.toml` file via `extend`.
pub extend_select: Option<Vec<RuleCodePrefix>>,
#[option(
default = "[]",