mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 05:25:17 +00:00
Switch some quotes to backticks in errors (#2889)
Improves consistency with the style decision in #723, I think.
This commit is contained in:
parent
3179fc110d
commit
2e41301520
11 changed files with 30 additions and 33 deletions
|
@ -17,10 +17,7 @@ impl Violation for HashlibInsecureHashFunction {
|
|||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
let HashlibInsecureHashFunction { string } = self;
|
||||
format!(
|
||||
"Probable use of insecure hash functions in `hashlib`: \"{}\"",
|
||||
string.escape_debug()
|
||||
)
|
||||
format!("Probable use of insecure hash functions in `hashlib`: `{string}`")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ define_violation!(
|
|||
impl Violation for ShebangPython {
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
format!("Shebang should contain \"python\"")
|
||||
format!("Shebang should contain `python`")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ impl Violation for PrefixTypeParams {
|
|||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
let PrefixTypeParams { kind } = self;
|
||||
format!("Name of private `{kind}` must start with _")
|
||||
format!("Name of private `{kind}` must start with `_`")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ define_violation!(
|
|||
impl Violation for UnrecognizedPlatformCheck {
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
format!("Unrecognized sys.platform check")
|
||||
format!("Unrecognized `sys.platform` check")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ impl AlwaysAutofixableViolation for InvalidEscapeSequence {
|
|||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
let InvalidEscapeSequence(char) = self;
|
||||
format!("Invalid escape sequence: '\\{char}'")
|
||||
format!("Invalid escape sequence: `\\{char}`")
|
||||
}
|
||||
|
||||
fn autofix_title(&self) -> String {
|
||||
|
|
|
@ -14,7 +14,7 @@ define_violation!(
|
|||
impl Violation for EscapeSequenceInDocstring {
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
format!(r#"Use r""" if any backslashes in a docstring"#)
|
||||
format!(r#"Use `r"""` if any backslashes in a docstring"#)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ define_violation!(
|
|||
impl Violation for TripleSingleQuotes {
|
||||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
format!(r#"Use """triple double quotes""""#)
|
||||
format!(r#"Use triple double quotes `"""`"#)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ impl Violation for PercentFormatUnsupportedFormatCharacter {
|
|||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
let PercentFormatUnsupportedFormatCharacter { char } = self;
|
||||
format!("`%`-format string has unsupported format character '{char}'")
|
||||
format!("`%`-format string has unsupported format character `{char}`")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ impl Violation for UselessElseOnLoop {
|
|||
#[derive_message_formats]
|
||||
fn message(&self) -> String {
|
||||
format!(
|
||||
"Else clause on loop without a break statement, remove the else and de-indent all the \
|
||||
"`else` clause on loop without a `break` statement; remove the `else` and de-indent all the \
|
||||
code inside it"
|
||||
)
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ impl AlwaysAutofixableViolation for AmbiguousUnicodeCharacterString {
|
|||
representant,
|
||||
} = self;
|
||||
format!(
|
||||
"String contains ambiguous unicode character '{confusable}' (did you mean \
|
||||
'{representant}'?)"
|
||||
"String contains ambiguous unicode character `{confusable}` (did you mean \
|
||||
`{representant}`?)"
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ impl AlwaysAutofixableViolation for AmbiguousUnicodeCharacterString {
|
|||
confusable,
|
||||
representant,
|
||||
} = self;
|
||||
format!("Replace '{confusable}' with '{representant}'")
|
||||
format!("Replace `{confusable}` with `{representant}`")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,8 +53,8 @@ impl AlwaysAutofixableViolation for AmbiguousUnicodeCharacterDocstring {
|
|||
representant,
|
||||
} = self;
|
||||
format!(
|
||||
"Docstring contains ambiguous unicode character '{confusable}' (did you mean \
|
||||
'{representant}'?)"
|
||||
"Docstring contains ambiguous unicode character `{confusable}` (did you mean \
|
||||
`{representant}`?)"
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ impl AlwaysAutofixableViolation for AmbiguousUnicodeCharacterDocstring {
|
|||
confusable,
|
||||
representant,
|
||||
} = self;
|
||||
format!("Replace '{confusable}' with '{representant}'")
|
||||
format!("Replace `{confusable}` with `{representant}`")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,8 +81,8 @@ impl AlwaysAutofixableViolation for AmbiguousUnicodeCharacterComment {
|
|||
representant,
|
||||
} = self;
|
||||
format!(
|
||||
"Comment contains ambiguous unicode character '{confusable}' (did you mean \
|
||||
'{representant}'?)"
|
||||
"Comment contains ambiguous unicode character `{confusable}` (did you mean \
|
||||
`{representant}`?)"
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ impl AlwaysAutofixableViolation for AmbiguousUnicodeCharacterComment {
|
|||
confusable,
|
||||
representant,
|
||||
} = self;
|
||||
format!("Replace '{confusable}' with '{representant}'")
|
||||
format!("Replace `{confusable}` with `{representant}`")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue