mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 21:05:08 +00:00
[flake8-markupsafe] Adds Implementation for MS001 via RUF035 (#14224)
Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
parent
b8a65182dd
commit
f82ee8ea59
16 changed files with 321 additions and 1 deletions
|
@ -1387,6 +1387,7 @@ impl Flake8ImportConventionsOptions {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize, OptionsMetadata, CombineOptions,
|
||||
)]
|
||||
|
@ -3005,6 +3006,19 @@ pub struct RuffOptions {
|
|||
"#
|
||||
)]
|
||||
pub parenthesize_tuple_in_subscript: Option<bool>,
|
||||
|
||||
/// A list of additional callable names that behave like [`markupsafe.Markup`].
|
||||
///
|
||||
/// Expects to receive a list of fully-qualified names (e.g., `webhelpers.html.literal`, rather than
|
||||
/// `literal`).
|
||||
///
|
||||
/// [markupsafe.Markup]: https://markupsafe.palletsprojects.com/en/stable/escaping/#markupsafe.Markup
|
||||
#[option(
|
||||
default = "[]",
|
||||
value_type = "list[str]",
|
||||
example = "extend-markup-names = [\"webhelpers.html.literal\", \"my_package.Markup\"]"
|
||||
)]
|
||||
pub extend_markup_names: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
impl RuffOptions {
|
||||
|
@ -3013,6 +3027,7 @@ impl RuffOptions {
|
|||
parenthesize_tuple_in_subscript: self
|
||||
.parenthesize_tuple_in_subscript
|
||||
.unwrap_or_default(),
|
||||
extend_markup_names: self.extend_markup_names.unwrap_or_default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue