From 5311c9329022a4e2078728d513ad09eb07c27f97 Mon Sep 17 00:00:00 2001 From: James Frost Date: Fri, 19 Apr 2024 14:18:30 +0100 Subject: [PATCH 1/3] [flake8-bugbear] Document explicitly disabling strict zip (`B905`) Occasionally you intentionally have iterables of differing lengths. The rule permits this by explicitly adding `strict=False`, but this was not documented. --- .../rules/flake8_bugbear/rules/zip_without_explicit_strict.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs b/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs index fd9d34f494e44..4c47a8cbb8b64 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs +++ b/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs @@ -17,7 +17,8 @@ use crate::fix::edits::add_argument; /// iterable. This can lead to subtle bugs. /// /// Use the `strict` parameter to raise a `ValueError` if the iterables are of -/// non-uniform length. +/// non-uniform length. If the iterables are intentionally different lengths the +/// parameter should be explicitly set to False. /// /// ## Example /// ```python From 20539e4cfc8b2893a521023dc5424309ba9418a3 Mon Sep 17 00:00:00 2001 From: James Frost Date: Fri, 19 Apr 2024 14:37:14 +0100 Subject: [PATCH 2/3] Add comma Co-authored-by: Vasco Schiavo <115561717+VascoSch92@users.noreply.github.com> --- .../rules/flake8_bugbear/rules/zip_without_explicit_strict.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs b/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs index 4c47a8cbb8b64..40bc710b00b0a 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs +++ b/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs @@ -17,7 +17,7 @@ use crate::fix::edits::add_argument; /// iterable. This can lead to subtle bugs. /// /// Use the `strict` parameter to raise a `ValueError` if the iterables are of -/// non-uniform length. If the iterables are intentionally different lengths the +/// non-uniform length. If the iterables are intentionally different lengths, the /// parameter should be explicitly set to False. /// /// ## Example From 2f4f016504408b6a7fc5188dd5420dbccf612ed9 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 19 Apr 2024 09:42:16 -0400 Subject: [PATCH 3/3] Update zip_without_explicit_strict.rs --- .../rules/flake8_bugbear/rules/zip_without_explicit_strict.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs b/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs index 40bc710b00b0a..4a1b7ecf6f69f 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs +++ b/crates/ruff_linter/src/rules/flake8_bugbear/rules/zip_without_explicit_strict.rs @@ -18,7 +18,7 @@ use crate::fix::edits::add_argument; /// /// Use the `strict` parameter to raise a `ValueError` if the iterables are of /// non-uniform length. If the iterables are intentionally different lengths, the -/// parameter should be explicitly set to False. +/// parameter should be explicitly set to `False`. /// /// ## Example /// ```python