From b78af2db4822dc55acbfb1024b30e69fe0262311 Mon Sep 17 00:00:00 2001 From: GiGaGon <107241144+MeGaGiGaGon@users.noreply.github.com> Date: Thu, 3 Jul 2025 07:25:46 -0700 Subject: [PATCH] [`flake8-quotes`] Make example error out-of-the-box (`Q003`) (#19106) ## Summary Part of #18972 This PR makes [avoidable-escaped-quote (Q003)](https://docs.astral.sh/ruff/rules/avoidable-escaped-quote/#avoidable-escaped-quote-q003)'s example error out-of-the-box [Old example](https://play.ruff.rs/fb319d0f-8016-46a1-b6bb-42b1b054feea) ```py foo = 'bar\'s' ``` [New example](https://play.ruff.rs/d9626561-0646-448f-9282-3f0691b90831) ```py foo = "bar\"s" ``` The original example got overwritten by `Q000`, since double quotes is the default config. The quotes were also switched in the "Use instead" section. ## Test Plan N/A, no functionality/tests affected --- .../src/rules/flake8_quotes/rules/avoidable_escaped_quote.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ruff_linter/src/rules/flake8_quotes/rules/avoidable_escaped_quote.rs b/crates/ruff_linter/src/rules/flake8_quotes/rules/avoidable_escaped_quote.rs index 80f1c03426..3a15f45154 100644 --- a/crates/ruff_linter/src/rules/flake8_quotes/rules/avoidable_escaped_quote.rs +++ b/crates/ruff_linter/src/rules/flake8_quotes/rules/avoidable_escaped_quote.rs @@ -19,12 +19,12 @@ use crate::{AlwaysFixableViolation, Edit, Fix}; /// /// ## Example /// ```python -/// foo = 'bar\'s' +/// foo = "bar\"s" /// ``` /// /// Use instead: /// ```python -/// foo = "bar's" +/// foo = 'bar"s' /// ``` /// /// ## Formatter compatibility