[flake8-builtins] Update documentation (A005) (#16097)
Some checks are pending
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions

Follow-up to https://github.com/astral-sh/ruff/pull/15951 to update
* the options links in A005 to reference
`lint.flake8-builtins.builtins-strict-checking`
* the description of the rule to explain strict vs non-strict checking
* the option documentation to point back to the rule
This commit is contained in:
Brent Westbrook 2025-02-12 12:50:13 -05:00 committed by GitHub
parent c31352f52b
commit f8093b65ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View file

@ -23,6 +23,14 @@ use crate::settings::LinterSettings;
/// Standard-library modules can be marked as exceptions to this rule via the
/// [`lint.flake8-builtins.builtins-allowed-modules`] configuration option.
///
/// By default, only the last component of the module name is considered, so `logging.py`,
/// `utils/logging.py`, and `utils/logging/__init__.py` would all clash with the builtin `logging`
/// module. With the [`lint.flake8-builtins.builtins-strict-checking`] option set to `false`, the
/// module path is considered, so only a top-level `logging.py` or `logging/__init__.py` will
/// trigger the rule and `utils/logging.py`, for example, would not. In preview mode, the default
/// value of [`lint.flake8-builtins.builtins-strict-checking`] is `false` rather than `true` in
/// stable mode.
///
/// This rule is not applied to stub files, as the name of a stub module is out
/// of the control of the author of the stub file. Instead, a stub should aim to
/// faithfully emulate the runtime module it is stubbing.
@ -43,6 +51,7 @@ use crate::settings::LinterSettings;
///
/// ## Options
/// - `lint.flake8-builtins.builtins-allowed-modules`
/// - `lint.flake8-builtins.builtins-strict-checking`
#[derive(ViolationMetadata)]
pub(crate) struct StdlibModuleShadowing {
name: String,