|
2 | 2 | source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs |
3 | 3 | --- |
4 | 4 | B005 Using `.strip()` with multi-character strings is misleading |
5 | | - --> B005.py:4:1 |
| 5 | + --> B005.py:4:3 |
6 | 6 | | |
7 | 7 | 2 | s.strip(s) # no warning |
8 | 8 | 3 | s.strip("we") # no warning |
9 | 9 | 4 | s.strip(".facebook.com") # warning |
10 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 10 | + | ^^^^^^^^^^^^^^^^^^^^^^ |
11 | 11 | 5 | s.strip("e") # no warning |
12 | 12 | 6 | s.strip("\n\t ") # no warning |
13 | 13 | | |
14 | 14 |
|
15 | 15 | B005 Using `.strip()` with multi-character strings is misleading |
16 | | - --> B005.py:7:1 |
| 16 | + --> B005.py:7:3 |
17 | 17 | | |
18 | 18 | 5 | s.strip("e") # no warning |
19 | 19 | 6 | s.strip("\n\t ") # no warning |
20 | 20 | 7 | s.strip(r"\n\t ") # warning |
21 | | - | ^^^^^^^^^^^^^^^^^ |
| 21 | + | ^^^^^^^^^^^^^^^ |
22 | 22 | 8 | s.lstrip(s) # no warning |
23 | 23 | 9 | s.lstrip("we") # no warning |
24 | 24 | | |
25 | 25 |
|
26 | | -B005 Using `.strip()` with multi-character strings is misleading |
27 | | - --> B005.py:10:1 |
| 26 | +B005 Using `.lstrip()` with multi-character strings is misleading |
| 27 | + --> B005.py:10:3 |
28 | 28 | | |
29 | 29 | 8 | s.lstrip(s) # no warning |
30 | 30 | 9 | s.lstrip("we") # no warning |
31 | 31 | 10 | s.lstrip(".facebook.com") # warning |
32 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 32 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
33 | 33 | 11 | s.lstrip("e") # no warning |
34 | 34 | 12 | s.lstrip("\n\t ") # no warning |
35 | 35 | | |
36 | 36 |
|
37 | | -B005 Using `.strip()` with multi-character strings is misleading |
38 | | - --> B005.py:13:1 |
| 37 | +B005 Using `.lstrip()` with multi-character strings is misleading |
| 38 | + --> B005.py:13:3 |
39 | 39 | | |
40 | 40 | 11 | s.lstrip("e") # no warning |
41 | 41 | 12 | s.lstrip("\n\t ") # no warning |
42 | 42 | 13 | s.lstrip(r"\n\t ") # warning |
43 | | - | ^^^^^^^^^^^^^^^^^^ |
| 43 | + | ^^^^^^^^^^^^^^^^ |
44 | 44 | 14 | s.rstrip(s) # no warning |
45 | 45 | 15 | s.rstrip("we") # warning |
46 | 46 | | |
47 | 47 |
|
48 | | -B005 Using `.strip()` with multi-character strings is misleading |
49 | | - --> B005.py:16:1 |
| 48 | +B005 Using `.rstrip()` with multi-character strings is misleading |
| 49 | + --> B005.py:16:3 |
50 | 50 | | |
51 | 51 | 14 | s.rstrip(s) # no warning |
52 | 52 | 15 | s.rstrip("we") # warning |
53 | 53 | 16 | s.rstrip(".facebook.com") # warning |
54 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 54 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
55 | 55 | 17 | s.rstrip("e") # no warning |
56 | 56 | 18 | s.rstrip("\n\t ") # no warning |
57 | 57 | | |
58 | 58 |
|
59 | | -B005 Using `.strip()` with multi-character strings is misleading |
60 | | - --> B005.py:19:1 |
| 59 | +B005 Using `.rstrip()` with multi-character strings is misleading |
| 60 | + --> B005.py:19:3 |
61 | 61 | | |
62 | 62 | 17 | s.rstrip("e") # no warning |
63 | 63 | 18 | s.rstrip("\n\t ") # no warning |
64 | 64 | 19 | s.rstrip(r"\n\t ") # warning |
65 | | - | ^^^^^^^^^^^^^^^^^^ |
| 65 | + | ^^^^^^^^^^^^^^^^ |
66 | 66 | 20 | s.strip("a") # no warning |
67 | 67 | 21 | s.strip("あ") # no warning |
68 | 68 | | |
69 | 69 |
|
70 | 70 | B005 Using `.strip()` with multi-character strings is misleading |
71 | | - --> B005.py:22:1 |
| 71 | + --> B005.py:22:3 |
72 | 72 | | |
73 | 73 | 20 | s.strip("a") # no warning |
74 | 74 | 21 | s.strip("あ") # no warning |
75 | 75 | 22 | s.strip("ああ") # warning |
76 | | - | ^^^^^^^^^^^^^^^ |
| 76 | + | ^^^^^^^^^^^^^ |
77 | 77 | 23 | s.strip("\ufeff") # no warning |
78 | 78 | 24 | s.strip("\u0074\u0065\u0073\u0074") # warning |
79 | 79 | | |
80 | 80 |
|
81 | 81 | B005 Using `.strip()` with multi-character strings is misleading |
82 | | - --> B005.py:24:1 |
| 82 | + --> B005.py:24:3 |
83 | 83 | | |
84 | 84 | 22 | s.strip("ああ") # warning |
85 | 85 | 23 | s.strip("\ufeff") # no warning |
86 | 86 | 24 | s.strip("\u0074\u0065\u0073\u0074") # warning |
87 | | - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
88 | | -25 | |
89 | | -26 | from somewhere import other_type, strip |
| 87 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 88 | +25 | s.strip("--").lstrip("--") # two warnings |
| 89 | + | |
| 90 | + |
| 91 | +B005 Using `.strip()` with multi-character strings is misleading |
| 92 | + --> B005.py:25:3 |
| 93 | + | |
| 94 | +23 | s.strip("\ufeff") # no warning |
| 95 | +24 | s.strip("\u0074\u0065\u0073\u0074") # warning |
| 96 | +25 | s.strip("--").lstrip("--") # two warnings |
| 97 | + | ^^^^^^^^^^^ |
| 98 | +26 | |
| 99 | +27 | from somewhere import other_type, strip |
| 100 | + | |
| 101 | + |
| 102 | +B005 Using `.lstrip()` with multi-character strings is misleading |
| 103 | + --> B005.py:25:15 |
| 104 | + | |
| 105 | +23 | s.strip("\ufeff") # no warning |
| 106 | +24 | s.strip("\u0074\u0065\u0073\u0074") # warning |
| 107 | +25 | s.strip("--").lstrip("--") # two warnings |
| 108 | + | ^^^^^^^^^^^^ |
| 109 | +26 | |
| 110 | +27 | from somewhere import other_type, strip |
90 | 111 | | |
0 commit comments