mirror of https://github.com/astral-sh/ruff
Fix incorrect reference in `extend-immutable-calls` documentation (#5890)
This commit is contained in:
parent
e1d76b60cc
commit
598549d24e
|
|
@ -4112,7 +4112,7 @@ where
|
|||
flake8_bugbear::rules::mutable_argument_default(self, arguments);
|
||||
}
|
||||
if self.enabled(Rule::FunctionCallInDefaultArgument) {
|
||||
flake8_bugbear::rules::function_call_argument_default(self, arguments);
|
||||
flake8_bugbear::rules::function_call_in_argument_default(self, arguments);
|
||||
}
|
||||
if self.settings.rules.enabled(Rule::ImplicitOptional) {
|
||||
ruff::rules::implicit_optional(self, arguments);
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ where
|
|||
}
|
||||
|
||||
/// B008
|
||||
pub(crate) fn function_call_argument_default(checker: &mut Checker, arguments: &Arguments) {
|
||||
pub(crate) fn function_call_in_argument_default(checker: &mut Checker, arguments: &Arguments) {
|
||||
// Map immutable calls to (module, member) format.
|
||||
let extend_immutable_calls: Vec<CallPath> = checker
|
||||
.settings
|
||||
|
|
@ -8,7 +8,7 @@ pub(crate) use duplicate_value::*;
|
|||
pub(crate) use except_with_empty_tuple::*;
|
||||
pub(crate) use except_with_non_exception_classes::*;
|
||||
pub(crate) use f_string_docstring::*;
|
||||
pub(crate) use function_call_argument_default::*;
|
||||
pub(crate) use function_call_in_argument_default::*;
|
||||
pub(crate) use function_uses_loop_variable::*;
|
||||
pub(crate) use getattr_with_constant::*;
|
||||
pub(crate) use jump_statement_in_finally::*;
|
||||
|
|
@ -42,7 +42,7 @@ mod duplicate_value;
|
|||
mod except_with_empty_tuple;
|
||||
mod except_with_non_exception_classes;
|
||||
mod f_string_docstring;
|
||||
mod function_call_argument_default;
|
||||
mod function_call_in_argument_default;
|
||||
mod function_uses_loop_variable;
|
||||
mod getattr_with_constant;
|
||||
mod jump_statement_in_finally;
|
||||
|
|
|
|||
|
|
@ -22,9 +22,12 @@ pub struct Options {
|
|||
extend-immutable-calls = ["fastapi.Depends", "fastapi.Query"]
|
||||
"#
|
||||
)]
|
||||
/// Additional callable functions to consider "immutable" when evaluating,
|
||||
/// e.g., the `no-mutable-default-argument` rule (`B006`) or
|
||||
/// `no-function-call-in-dataclass-defaults` rule (`RUF009`).
|
||||
/// Additional callable functions to consider "immutable" when evaluating, e.g., the
|
||||
/// `function-call-in-default-argument` rule (`B008`) or `function-call-in-dataclass-defaults`
|
||||
/// rule (`RUF009`).
|
||||
///
|
||||
/// Expects to receive a list of fully-qualified names (e.g., `fastapi.Query`, rather than
|
||||
/// `Query`).
|
||||
pub extend_immutable_calls: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ pub struct Options {
|
|||
/// Additional functions or classes to consider generic, such that any
|
||||
/// subscripts should be treated as type annotation (e.g., `ForeignKey` in
|
||||
/// `django.db.models.ForeignKey["User"]`.
|
||||
///
|
||||
/// Expects to receive a list of fully-qualified names (e.g., `django.db.models.ForeignKey`,
|
||||
/// rather than `ForeignKey`).
|
||||
pub extend_generics: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -720,7 +720,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"extend-immutable-calls": {
|
||||
"description": "Additional callable functions to consider \"immutable\" when evaluating, e.g., the `no-mutable-default-argument` rule (`B006`) or `no-function-call-in-dataclass-defaults` rule (`RUF009`).",
|
||||
"description": "Additional callable functions to consider \"immutable\" when evaluating, e.g., the `function-call-in-default-argument` rule (`B008`) or `function-call-in-dataclass-defaults` rule (`RUF009`).\n\nExpects to receive a list of fully-qualified names (e.g., `fastapi.Query`, rather than `Query`).",
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
|
|
@ -1515,7 +1515,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"extend-generics": {
|
||||
"description": "Additional functions or classes to consider generic, such that any subscripts should be treated as type annotation (e.g., `ForeignKey` in `django.db.models.ForeignKey[\"User\"]`.",
|
||||
"description": "Additional functions or classes to consider generic, such that any subscripts should be treated as type annotation (e.g., `ForeignKey` in `django.db.models.ForeignKey[\"User\"]`.\n\nExpects to receive a list of fully-qualified names (e.g., `django.db.models.ForeignKey`, rather than `ForeignKey`).",
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
|
|
|
|||
Loading…
Reference in New Issue