From d85950ce5a951fb967ead47870aa068f0486c883 Mon Sep 17 00:00:00 2001 From: Ahmed Ashraf <104530599+Ahmed-Abdou14@users.noreply.github.com> Date: Wed, 18 Oct 2023 01:32:39 +0300 Subject: [PATCH] Update rule B005 docs (#8028) ## Summary Rule B005 of flake8-bugbear docs has a typo in one of the examples that leads to a confusion in the correctness of `.strip()` method ![image](https://github.com/astral-sh/ruff/assets/104530599/b4e19751-558e-4ebb-b82f-25c321ddc32b) ```python # Wrong output (used in docs) "text.txt".strip(".txt") # "ex" # Correct output "text.txt".strip(".txt") # "e" ``` --- .../rules/flake8_bugbear/rules/strip_with_multi_characters.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/rules/strip_with_multi_characters.rs b/crates/ruff_linter/src/rules/flake8_bugbear/rules/strip_with_multi_characters.rs index ae50f8ff2f..3fd3dacdaa 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/rules/strip_with_multi_characters.rs +++ b/crates/ruff_linter/src/rules/flake8_bugbear/rules/strip_with_multi_characters.rs @@ -34,7 +34,7 @@ use crate::checkers::ast::Checker; /// /// ## Example /// ```python -/// "text.txt".strip(".txt") # "ex" +/// "text.txt".strip(".txt") # "e" /// ``` /// /// Use instead: