From 565136cc7739e6b0ce1735edce127a710ecc802c Mon Sep 17 00:00:00 2001 From: Aurelio Jargas Date: Tue, 26 Mar 2024 00:37:26 +0100 Subject: [PATCH 1/2] Fix list markup: blank line required It looks like a blank line is required to separate the previous paragraph from the first list item. Otherwise the list is considered part of the paragraph. The current renderings from those two parts are in: - https://docs.astral.sh/ruff/settings/#lint_flake8-copyright_notice-rgx - https://docs.astral.sh/ruff/settings/#format_quote-style --- crates/ruff_workspace/src/options.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ruff_workspace/src/options.rs b/crates/ruff_workspace/src/options.rs index 6fca0e887cd70..59e78df4329c2 100644 --- a/crates/ruff_workspace/src/options.rs +++ b/crates/ruff_workspace/src/options.rs @@ -1133,6 +1133,7 @@ pub struct Flake8CopyrightOptions { /// with the [`regex`](https://docs.rs/regex/latest/regex/) crate. /// Defaults to `(?i)Copyright\s+((?:\(C\)|©)\s+)?\d{4}((-|,\s)\d{4})*`, which matches /// the following: + /// /// - `Copyright 2023` /// - `Copyright (C) 2023` /// - `Copyright 2021-2023` @@ -2962,6 +2963,7 @@ pub struct FormatOptions { pub indent_style: Option, /// Configures the preferred quote character for strings. The recommended options are + /// /// * `double` (default): Use double quotes `"` /// * `single`: Use single quotes `'` /// From 9e0b5d291713eab6615d01dd2b730d628c72052c Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 25 Mar 2024 20:08:48 -0400 Subject: [PATCH 2/2] Update schema --- ruff.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruff.schema.json b/ruff.schema.json index 59985f625a479..ad659af9f05fd 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -959,7 +959,7 @@ "minimum": 0.0 }, "notice-rgx": { - "description": "The regular expression used to match the copyright notice, compiled with the [`regex`](https://docs.rs/regex/latest/regex/) crate. Defaults to `(?i)Copyright\\s+((?:\\(C\\)|©)\\s+)?\\d{4}((-|,\\s)\\d{4})*`, which matches the following: - `Copyright 2023` - `Copyright (C) 2023` - `Copyright 2021-2023` - `Copyright (C) 2021-2023` - `Copyright (C) 2021, 2023`", + "description": "The regular expression used to match the copyright notice, compiled with the [`regex`](https://docs.rs/regex/latest/regex/) crate. Defaults to `(?i)Copyright\\s+((?:\\(C\\)|©)\\s+)?\\d{4}((-|,\\s)\\d{4})*`, which matches the following:\n\n- `Copyright 2023` - `Copyright (C) 2023` - `Copyright 2021-2023` - `Copyright (C) 2021-2023` - `Copyright (C) 2021, 2023`", "type": [ "string", "null" @@ -1376,7 +1376,7 @@ ] }, "quote-style": { - "description": "Configures the preferred quote character for strings. The recommended options are * `double` (default): Use double quotes `\"` * `single`: Use single 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 triple quoted strings and docstrings even when using `quote-style = \"single\"`.\n\nRuff deviates from using the configured quotes if doing so prevents the need for escaping quote characters inside the string:\n\n```python a = \"a string without any quotes\" b = \"It's monday morning\" ```\n\nRuff will change the quotes of the string assigned to `a` to single quotes when using `quote-style = \"single\"`. However, ruff uses double quotes for he string assigned to `b` because using single quotes would require escaping the `'`, which leads to the less readable code: `'It\\'s monday morning'`.\n\nIn addition, Ruff supports the quote style `preserve` for projects that already use a mixture of single and double quotes and can't migrate to the `double` or `single` style. The quote style `preserve` leaves the quotes of all strings unchanged.", + "description": "Configures the preferred quote character for strings. The recommended options are\n\n* `double` (default): Use double quotes `\"` * `single`: Use single 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 triple quoted strings and docstrings even when using `quote-style = \"single\"`.\n\nRuff deviates from using the configured quotes if doing so prevents the need for escaping quote characters inside the string:\n\n```python a = \"a string without any quotes\" b = \"It's monday morning\" ```\n\nRuff will change the quotes of the string assigned to `a` to single quotes when using `quote-style = \"single\"`. However, ruff uses double quotes for he string assigned to `b` because using single quotes would require escaping the `'`, which leads to the less readable code: `'It\\'s monday morning'`.\n\nIn addition, Ruff supports the quote style `preserve` for projects that already use a mixture of single and double quotes and can't migrate to the `double` or `single` style. The quote style `preserve` leaves the quotes of all strings unchanged.", "anyOf": [ { "$ref": "#/definitions/QuoteStyle"