From 03503f7f566be367f577c7077c717dd578249bca Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Tue, 24 Sep 2024 14:55:32 +0200 Subject: [PATCH] C401 message missing closing parenthesis (#13498) --- .../rules/unnecessary_generator_set.rs | 2 +- ...flake8_comprehensions__tests__C401_C401.py.snap | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/rules/unnecessary_generator_set.rs b/crates/ruff_linter/src/rules/flake8_comprehensions/rules/unnecessary_generator_set.rs index a22223110e51dd..2a69d993b5a00d 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/rules/unnecessary_generator_set.rs +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/rules/unnecessary_generator_set.rs @@ -47,7 +47,7 @@ impl AlwaysFixableViolation for UnnecessaryGeneratorSet { #[derive_message_formats] fn message(&self) -> String { if self.short_circuit { - format!("Unnecessary generator (rewrite using `set()`") + format!("Unnecessary generator (rewrite using `set()`)") } else { format!("Unnecessary generator (rewrite as a `set` comprehension)") } diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap index fdde5715682af8..be566d8e53a0eb 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/snapshots/ruff_linter__rules__flake8_comprehensions__tests__C401_C401.py.snap @@ -103,7 +103,7 @@ C401.py:12:17: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) 14 14 | 15 15 | # Short-circuit case, combine with C416 and should produce x = set(range(3)) -C401.py:16:5: C401 [*] Unnecessary generator (rewrite using `set()` +C401.py:16:5: C401 [*] Unnecessary generator (rewrite using `set()`) | 15 | # Short-circuit case, combine with C416 and should produce x = set(range(3)) 16 | x = set(x for x in range(3)) @@ -123,7 +123,7 @@ C401.py:16:5: C401 [*] Unnecessary generator (rewrite using `set()` 18 18 | x for x in range(3) 19 19 | ) -C401.py:17:5: C401 [*] Unnecessary generator (rewrite using `set()` +C401.py:17:5: C401 [*] Unnecessary generator (rewrite using `set()`) | 15 | # Short-circuit case, combine with C416 and should produce x = set(range(3)) 16 | x = set(x for x in range(3)) @@ -149,7 +149,7 @@ C401.py:17:5: C401 [*] Unnecessary generator (rewrite using `set()` 21 19 | print(f"{set(a for a in 'abc') - set(a for a in 'ab')}") 22 20 | print(f"{ set(a for a in 'abc') - set(a for a in 'ab') }") -C401.py:20:16: C401 [*] Unnecessary generator (rewrite using `set()` +C401.py:20:16: C401 [*] Unnecessary generator (rewrite using `set()`) | 18 | x for x in range(3) 19 | ) @@ -170,7 +170,7 @@ C401.py:20:16: C401 [*] Unnecessary generator (rewrite using `set()` 22 22 | print(f"{ set(a for a in 'abc') - set(a for a in 'ab') }") 23 23 | -C401.py:21:10: C401 [*] Unnecessary generator (rewrite using `set()` +C401.py:21:10: C401 [*] Unnecessary generator (rewrite using `set()`) | 19 | ) 20 | print(f"Hello {set(a for a in range(3))} World") @@ -190,7 +190,7 @@ C401.py:21:10: C401 [*] Unnecessary generator (rewrite using `set()` 23 23 | 24 24 | -C401.py:21:34: C401 [*] Unnecessary generator (rewrite using `set()` +C401.py:21:34: C401 [*] Unnecessary generator (rewrite using `set()`) | 19 | ) 20 | print(f"Hello {set(a for a in range(3))} World") @@ -210,7 +210,7 @@ C401.py:21:34: C401 [*] Unnecessary generator (rewrite using `set()` 23 23 | 24 24 | -C401.py:22:11: C401 [*] Unnecessary generator (rewrite using `set()` +C401.py:22:11: C401 [*] Unnecessary generator (rewrite using `set()`) | 20 | print(f"Hello {set(a for a in range(3))} World") 21 | print(f"{set(a for a in 'abc') - set(a for a in 'ab')}") @@ -229,7 +229,7 @@ C401.py:22:11: C401 [*] Unnecessary generator (rewrite using `set()` 24 24 | 25 25 | # Not built-in set. -C401.py:22:35: C401 [*] Unnecessary generator (rewrite using `set()` +C401.py:22:35: C401 [*] Unnecessary generator (rewrite using `set()`) | 20 | print(f"Hello {set(a for a in range(3))} World") 21 | print(f"{set(a for a in 'abc') - set(a for a in 'ab')}")