[flake8-markupsafe] Adds Implementation for MS001 via RUF035 (#14224)

Co-authored-by: Micha Reiser <micha@reiser.io>
This commit is contained in:
David Salvisberg 2024-11-11 19:30:03 +01:00 committed by GitHub
parent b8a65182dd
commit f82ee8ea59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 321 additions and 1 deletions

View file

@ -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(),
}
}
}