diff --git a/README.md b/README.md index e4431f5f8d..2ee287084c 100644 --- a/README.md +++ b/README.md @@ -729,7 +729,7 @@ For more, see [Pyflakes](https://pypi.org/project/pyflakes/) on PyPI. | F506 | percent-format-mixed-positional-and-named | `%`-format string has mixed positional and named placeholders | | | F507 | percent-format-positional-count-mismatch | `%`-format string has {wanted} placeholder(s) but {got} substitution(s) | | | F508 | percent-format-star-requires-sequence | `%`-format string `*` specifier requires sequence | | -| F509 | percent-format-unsupported-format-character | `%`-format string has unsupported format character '{char}' | | +| F509 | percent-format-unsupported-format-character | `%`-format string has unsupported format character `{char}` | | | F521 | string-dot-format-invalid-format | `.format` call has invalid format string: {message} | | | F522 | string-dot-format-extra-named-arguments | `.format` call has unused named argument(s): {message} | 🛠 | | F523 | string-dot-format-extra-positional-arguments | `.format` call has unused arguments at position(s): {message} | | @@ -792,7 +792,7 @@ For more, see [pycodestyle](https://pypi.org/project/pycodestyle/) on PyPI. | ---- | ---- | ------- | --- | | W292 | no-new-line-at-end-of-file | No newline at end of file | 🛠 | | W505 | doc-line-too-long | Doc line too long ({length} > {limit} characters) | | -| W605 | invalid-escape-sequence | Invalid escape sequence: '\{char}' | 🛠 | +| W605 | invalid-escape-sequence | Invalid escape sequence: `\{char}` | 🛠 | ### mccabe (C90) @@ -863,8 +863,8 @@ For more, see [pydocstyle](https://pypi.org/project/pydocstyle/) on PyPI. | D213 | multi-line-summary-second-line | Multi-line docstring summary should start at the second line | 🛠 | | D214 | section-not-over-indented | Section is over-indented ("{name}") | 🛠 | | D215 | section-underline-not-over-indented | Section underline is over-indented ("{name}") | 🛠 | -| D300 | triple-single-quotes | Use """triple double quotes""" | | -| D301 | escape-sequence-in-docstring | Use r""" if any backslashes in a docstring | | +| D300 | triple-single-quotes | Use triple double quotes `"""` | | +| D301 | escape-sequence-in-docstring | Use `r"""` if any backslashes in a docstring | | | D400 | ends-in-period | First line should end with a period | 🛠 | | D401 | non-imperative-mood | First line of docstring should be in imperative mood: "{first_line}" | | | D402 | no-signature | First line should not be the function's signature | | @@ -980,7 +980,7 @@ For more, see [flake8-bandit](https://pypi.org/project/flake8-bandit/) on PyPI. | S110 | try-except-pass | `try`-`except`-`pass` detected, consider logging the exception | | | S112 | try-except-continue | `try`-`except`-`continue` detected, consider logging the exception | | | S113 | request-without-timeout | Probable use of requests call with timeout set to `{value}` | | -| S324 | hashlib-insecure-hash-function | Probable use of insecure hash functions in `hashlib`: "{}" | | +| S324 | hashlib-insecure-hash-function | Probable use of insecure hash functions in `hashlib`: `{string}` | | | S501 | request-with-no-cert-validation | Probable use of `{string}` call with `verify=False` disabling SSL certificate checks | | | S506 | unsafe-yaml-load | Probable use of unsafe loader `{name}` with `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`. | | | S508 | snmp-insecure-version | The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. | | @@ -1137,7 +1137,7 @@ For more, see [flake8-executable](https://pypi.org/project/flake8-executable/) o | ---- | ---- | ------- | --- | | EXE001 | shebang-not-executable | Shebang is present but file is not executable | | | EXE002 | shebang-missing-executable-file | The file is executable but no shebang is present | | -| EXE003 | shebang-python | Shebang should contain "python" | | +| EXE003 | shebang-python | Shebang should contain `python` | | | EXE004 | shebang-whitespace | Avoid whitespace before shebang | 🛠 | | EXE005 | shebang-newline | Shebang should be at the beginning of the file | | @@ -1211,8 +1211,8 @@ For more, see [flake8-pyi](https://pypi.org/project/flake8-pyi/) on PyPI. | Code | Name | Message | Fix | | ---- | ---- | ------- | --- | -| PYI001 | [prefix-type-params](https://beta.ruff.rs/docs/rules/prefix-type-params/) | Name of private `{kind}` must start with _ | | -| PYI007 | [unrecognized-platform-check](https://beta.ruff.rs/docs/rules/unrecognized-platform-check/) | Unrecognized sys.platform check | | +| PYI001 | [prefix-type-params](https://beta.ruff.rs/docs/rules/prefix-type-params/) | Name of private `{kind}` must start with `_` | | +| PYI007 | [unrecognized-platform-check](https://beta.ruff.rs/docs/rules/unrecognized-platform-check/) | Unrecognized `sys.platform` check | | | PYI008 | [unrecognized-platform-name](https://beta.ruff.rs/docs/rules/unrecognized-platform-name/) | Unrecognized platform `{platform}` | | ### flake8-pytest-style (PT) @@ -1469,7 +1469,7 @@ For more, see [Pylint](https://pypi.org/project/pylint/) on PyPI. | Code | Name | Message | Fix | | ---- | ---- | ------- | --- | -| PLW0120 | useless-else-on-loop | Else clause on loop without a break statement, remove the else and de-indent all the code inside it | | +| PLW0120 | useless-else-on-loop | `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it | | | PLW0602 | global-variable-not-assigned | Using global for `{name}` but no assignment is done | | ### tryceratops (TRY) @@ -1491,9 +1491,9 @@ For more, see [tryceratops](https://pypi.org/project/tryceratops/1.1.0/) on PyPI | Code | Name | Message | Fix | | ---- | ---- | ------- | --- | -| RUF001 | ambiguous-unicode-character-string | String contains ambiguous unicode character '{confusable}' (did you mean '{representant}'?) | 🛠 | -| RUF002 | ambiguous-unicode-character-docstring | Docstring contains ambiguous unicode character '{confusable}' (did you mean '{representant}'?) | 🛠 | -| RUF003 | ambiguous-unicode-character-comment | Comment contains ambiguous unicode character '{confusable}' (did you mean '{representant}'?) | 🛠 | +| RUF001 | ambiguous-unicode-character-string | String contains ambiguous unicode character `{confusable}` (did you mean `{representant}`?) | 🛠 | +| RUF002 | ambiguous-unicode-character-docstring | Docstring contains ambiguous unicode character `{confusable}` (did you mean `{representant}`?) | 🛠 | +| RUF003 | ambiguous-unicode-character-comment | Comment contains ambiguous unicode character `{confusable}` (did you mean `{representant}`?) | 🛠 | | RUF004 | keyword-argument-before-star-argument | Keyword argument `{name}` must come after starred arguments | | | RUF005 | unpack-instead-of-concatenating-to-collection-literal | Consider `{expr}` instead of concatenation | 🛠 | | RUF100 | unused-noqa | Unused `noqa` directive | 🛠 | diff --git a/crates/ruff/src/rules/flake8_bandit/rules/hashlib_insecure_hash_functions.rs b/crates/ruff/src/rules/flake8_bandit/rules/hashlib_insecure_hash_functions.rs index 03313bd89a..be7d750f1b 100644 --- a/crates/ruff/src/rules/flake8_bandit/rules/hashlib_insecure_hash_functions.rs +++ b/crates/ruff/src/rules/flake8_bandit/rules/hashlib_insecure_hash_functions.rs @@ -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}`") } } diff --git a/crates/ruff/src/rules/flake8_executable/rules/shebang_python.rs b/crates/ruff/src/rules/flake8_executable/rules/shebang_python.rs index 96d1329aa2..833d71f47a 100644 --- a/crates/ruff/src/rules/flake8_executable/rules/shebang_python.rs +++ b/crates/ruff/src/rules/flake8_executable/rules/shebang_python.rs @@ -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`") } } diff --git a/crates/ruff/src/rules/flake8_pyi/rules/prefix_type_params.rs b/crates/ruff/src/rules/flake8_pyi/rules/prefix_type_params.rs index 860431f512..3a1da9befb 100644 --- a/crates/ruff/src/rules/flake8_pyi/rules/prefix_type_params.rs +++ b/crates/ruff/src/rules/flake8_pyi/rules/prefix_type_params.rs @@ -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 `_`") } } diff --git a/crates/ruff/src/rules/flake8_pyi/rules/unrecognized_platform.rs b/crates/ruff/src/rules/flake8_pyi/rules/unrecognized_platform.rs index e2068ec8f8..266d16ffec 100644 --- a/crates/ruff/src/rules/flake8_pyi/rules/unrecognized_platform.rs +++ b/crates/ruff/src/rules/flake8_pyi/rules/unrecognized_platform.rs @@ -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") } } diff --git a/crates/ruff/src/rules/pycodestyle/rules/invalid_escape_sequence.rs b/crates/ruff/src/rules/pycodestyle/rules/invalid_escape_sequence.rs index f5ee02b65b..dea4dbd73d 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/invalid_escape_sequence.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/invalid_escape_sequence.rs @@ -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 { diff --git a/crates/ruff/src/rules/pydocstyle/rules/backslashes.rs b/crates/ruff/src/rules/pydocstyle/rules/backslashes.rs index 5196919f81..5094a54fbf 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/backslashes.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/backslashes.rs @@ -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"#) } } diff --git a/crates/ruff/src/rules/pydocstyle/rules/triple_quotes.rs b/crates/ruff/src/rules/pydocstyle/rules/triple_quotes.rs index aeebc2ad96..d9dc2fe36c 100644 --- a/crates/ruff/src/rules/pydocstyle/rules/triple_quotes.rs +++ b/crates/ruff/src/rules/pydocstyle/rules/triple_quotes.rs @@ -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 `"""`"#) } } diff --git a/crates/ruff/src/rules/pyflakes/rules/strings.rs b/crates/ruff/src/rules/pyflakes/rules/strings.rs index 04bb7d3d3a..118c20b365 100644 --- a/crates/ruff/src/rules/pyflakes/rules/strings.rs +++ b/crates/ruff/src/rules/pyflakes/rules/strings.rs @@ -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}`") } } diff --git a/crates/ruff/src/rules/pylint/rules/useless_else_on_loop.rs b/crates/ruff/src/rules/pylint/rules/useless_else_on_loop.rs index a77f7fdd67..108d53e14a 100644 --- a/crates/ruff/src/rules/pylint/rules/useless_else_on_loop.rs +++ b/crates/ruff/src/rules/pylint/rules/useless_else_on_loop.rs @@ -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" ) } diff --git a/crates/ruff/src/rules/ruff/rules/ambiguous_unicode_character.rs b/crates/ruff/src/rules/ruff/rules/ambiguous_unicode_character.rs index e5be590837..08cbd958d0 100644 --- a/crates/ruff/src/rules/ruff/rules/ambiguous_unicode_character.rs +++ b/crates/ruff/src/rules/ruff/rules/ambiguous_unicode_character.rs @@ -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}`") } }