From d53e5cd25a9156bed4422d2d734d9dd076e427cd Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Mon, 9 Dec 2024 03:51:59 +0300 Subject: [PATCH] [flake8-commas]: Fix example replacement in docs (#14843) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Minor change for the documentation of COM818 rule. This was a block called “In the event that a tuple is intended”, but the suggested change did not produce a tuple. ## Test Plan ```python >>> import json >>> (json.dumps({"bar": 1}),) # this is a tuple ('{"bar": 1}',) >>> (json.dumps({"bar": 1})) # not a tuple '{"bar": 1}' ``` --- .../src/rules/flake8_commas/rules/trailing_commas.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/rules/flake8_commas/rules/trailing_commas.rs b/crates/ruff_linter/src/rules/flake8_commas/rules/trailing_commas.rs index ddc4d076a5..bc20c966a0 100644 --- a/crates/ruff_linter/src/rules/flake8_commas/rules/trailing_commas.rs +++ b/crates/ruff_linter/src/rules/flake8_commas/rules/trailing_commas.rs @@ -188,7 +188,7 @@ impl AlwaysFixableViolation for MissingTrailingComma { /// import json /// /// -/// foo = (json.dumps({"bar": 1})) +/// foo = (json.dumps({"bar": 1}),) /// ``` #[derive(ViolationMetadata)] pub(crate) struct TrailingCommaOnBareTuple;