Re-enable clippy useless-format (#14095)
Some checks are pending
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo shear (push) Blocked by required conditions
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (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) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (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

This commit is contained in:
Simon Brugman 2024-11-04 18:25:25 +01:00 committed by GitHub
parent fb94b71e63
commit b7e32b0a18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 7 additions and 5 deletions

View file

@ -85,7 +85,8 @@ pub struct ReturnInGenerator;
impl Violation for ReturnInGenerator {
#[derive_message_formats]
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()
}
}

View file

@ -47,7 +47,7 @@ impl Violation for UnnecessaryLiteralUnion {
}
fn fix_title(&self) -> Option<String> {
Some(format!("Replace with a single `Literal`",))
Some("Replace with a single `Literal`".to_string())
}
}

View file

@ -37,7 +37,7 @@ impl Violation for UnnecessaryTypeUnion {
#[derive_message_formats]
fn message(&self) -> String {
let union_str = if self.is_pep604_union {
format!("{}", self.members.join(" | "))
self.members.join(" | ")
} else {
format!("Union[{}]", self.members.join(", "))
};

View file

@ -1,4 +1,3 @@
#![allow(clippy::useless_format)]
pub mod airflow;
pub mod eradicate;
pub mod fastapi;

View file

@ -30,6 +30,8 @@ pub struct IOError {
/// E902
impl Violation for IOError {
// The format message is used by the `derive_message_formats` macro.
#![allow(clippy::useless_format)]
#[derive_message_formats]
fn message(&self) -> String {
let IOError { message } = self;

View file

@ -53,7 +53,7 @@ impl Violation for EscapeSequenceInDocstring {
}
fn fix_title(&self) -> Option<String> {
Some(format!(r#"Add `r` prefix"#))
Some(r#"Add `r` prefix"#.to_string())
}
}