From e2c6c0606bc97d04c0d1bb6fc9c578ff9b2db99f Mon Sep 17 00:00:00 2001 From: Eiko Wagenknecht Date: Tue, 17 Oct 2023 15:43:56 +0200 Subject: [PATCH 1/3] docs: fix typo in options.rs --- crates/ruff_workspace/src/options.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index eaf1cd22fe058f..9250f4c1666839 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -2509,7 +2509,7 @@ pub struct FormatOptions { /// ``` /// /// Ruff will change `a` to use single quotes when using `quote-style = "single"`. However, - /// `a` will be unchanged, as converting to single quotes would require the inner `'` to be + /// `b` will be unchanged, as converting to single quotes would require the inner `'` to be /// escaped, which leads to less readable code: `'It\'s monday morning'`. #[option( default = r#"double"#, From 70261603ec68e27997c732ac0e5c3e94c6edcd3e Mon Sep 17 00:00:00 2001 From: Eiko Wagenknecht Date: Tue, 17 Oct 2023 15:49:49 +0200 Subject: [PATCH 2/3] fix: typo in docs --- ruff.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruff.schema.json b/ruff.schema.json index 1c49b5838559dd..0fac00d749fff0 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -1239,7 +1239,7 @@ ] }, "quote-style": { - "description": "Whether to prefer single `'` or double `\"` quotes for strings. Defaults to double quotes.\n\nIn compliance with [PEP 8](https://peps.python.org/pep-0008/) and [PEP 257](https://peps.python.org/pep-0257/), Ruff prefers double quotes for multiline strings and docstrings, regardless of the configured quote style.\n\nRuff may also deviate from this option if using the configured quotes would require escaping quote characters within the string. For example, given:\n\n```python a = \"a string without any quotes\" b = \"It's monday morning\" ```\n\nRuff will change `a` to use single quotes when using `quote-style = \"single\"`. However, `a` will be unchanged, as converting to single quotes would require the inner `'` to be escaped, which leads to less readable code: `'It\\'s monday morning'`.", + "description": "Whether to prefer single `'` or double `\"` quotes for strings. Defaults to double quotes.\n\nIn compliance with [PEP 8](https://peps.python.org/pep-0008/) and [PEP 257](https://peps.python.org/pep-0257/), Ruff prefers double quotes for multiline strings and docstrings, regardless of the configured quote style.\n\nRuff may also deviate from this option if using the configured quotes would require escaping quote characters within the string. For example, given:\n\n```python a = \"a string without any quotes\" b = \"It's monday morning\" ```\n\nRuff will change `a` to use single quotes when using `quote-style = \"single\"`. However, `b` will be unchanged, as converting to single quotes would require the inner `'` to be escaped, which leads to less readable code: `'It\\'s monday morning'`.", "anyOf": [ { "$ref": "#/definitions/QuoteStyle" @@ -3491,4 +3491,4 @@ "type": "string" } } -} \ No newline at end of file +} From 9be9abb1f1f492bf5de30a252fd9b9b48db18e7c Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Tue, 17 Oct 2023 10:08:10 -0400 Subject: [PATCH 3/3] Update JSON schema --- ruff.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruff.schema.json b/ruff.schema.json index 0fac00d749fff0..9752f750363cbb 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -3491,4 +3491,4 @@ "type": "string" } } -} +} \ No newline at end of file