mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 15:15:33 +00:00
Re-enable clippy useless-format
(#14095)
This commit is contained in:
parent
fb94b71e63
commit
b7e32b0a18
6 changed files with 7 additions and 5 deletions
|
@ -85,7 +85,8 @@ pub struct ReturnInGenerator;
|
||||||
impl Violation for ReturnInGenerator {
|
impl Violation for ReturnInGenerator {
|
||||||
#[derive_message_formats]
|
#[derive_message_formats]
|
||||||
fn message(&self) -> String {
|
fn message(&self) -> String {
|
||||||
format!("Using `yield` and `return {{value}}` in a generator function can lead to confusing behavior")
|
"Using `yield` and `return {value}` in a generator function can lead to confusing behavior"
|
||||||
|
.to_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ impl Violation for UnnecessaryLiteralUnion {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fix_title(&self) -> Option<String> {
|
fn fix_title(&self) -> Option<String> {
|
||||||
Some(format!("Replace with a single `Literal`",))
|
Some("Replace with a single `Literal`".to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ impl Violation for UnnecessaryTypeUnion {
|
||||||
#[derive_message_formats]
|
#[derive_message_formats]
|
||||||
fn message(&self) -> String {
|
fn message(&self) -> String {
|
||||||
let union_str = if self.is_pep604_union {
|
let union_str = if self.is_pep604_union {
|
||||||
format!("{}", self.members.join(" | "))
|
self.members.join(" | ")
|
||||||
} else {
|
} else {
|
||||||
format!("Union[{}]", self.members.join(", "))
|
format!("Union[{}]", self.members.join(", "))
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![allow(clippy::useless_format)]
|
|
||||||
pub mod airflow;
|
pub mod airflow;
|
||||||
pub mod eradicate;
|
pub mod eradicate;
|
||||||
pub mod fastapi;
|
pub mod fastapi;
|
||||||
|
|
|
@ -30,6 +30,8 @@ pub struct IOError {
|
||||||
|
|
||||||
/// E902
|
/// E902
|
||||||
impl Violation for IOError {
|
impl Violation for IOError {
|
||||||
|
// The format message is used by the `derive_message_formats` macro.
|
||||||
|
#![allow(clippy::useless_format)]
|
||||||
#[derive_message_formats]
|
#[derive_message_formats]
|
||||||
fn message(&self) -> String {
|
fn message(&self) -> String {
|
||||||
let IOError { message } = self;
|
let IOError { message } = self;
|
||||||
|
|
|
@ -53,7 +53,7 @@ impl Violation for EscapeSequenceInDocstring {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fix_title(&self) -> Option<String> {
|
fn fix_title(&self) -> Option<String> {
|
||||||
Some(format!(r#"Add `r` prefix"#))
|
Some(r#"Add `r` prefix"#.to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue