|
| 1 | +--- |
| 2 | +source: crates/ruff_linter/src/rules/pylint/mod.rs |
| 3 | +--- |
| 4 | +bad_str_strip_call.py:2:21: PLE1310 String `strip` call contains duplicate characters |
| 5 | + | |
| 6 | +1 | # PLE1310 |
| 7 | +2 | "Hello World".strip("Hello") |
| 8 | + | ^^^^^^^ PLE1310 |
| 9 | +3 | |
| 10 | +4 | # PLE1310 |
| 11 | + | |
| 12 | + |
| 13 | +bad_str_strip_call.py:5:21: PLE1310 String `strip` call contains duplicate characters |
| 14 | + | |
| 15 | +4 | # PLE1310 |
| 16 | +5 | "Hello World".strip("Hello") |
| 17 | + | ^^^^^^^ PLE1310 |
| 18 | +6 | |
| 19 | +7 | # PLE1310 |
| 20 | + | |
| 21 | + |
| 22 | +bad_str_strip_call.py:8:21: PLE1310 String `strip` call contains duplicate characters |
| 23 | + | |
| 24 | + 7 | # PLE1310 |
| 25 | + 8 | "Hello World".strip(u"Hello") |
| 26 | + | ^^^^^^^^ PLE1310 |
| 27 | + 9 | |
| 28 | +10 | # PLE1310 |
| 29 | + | |
| 30 | + |
| 31 | +bad_str_strip_call.py:11:21: PLE1310 String `strip` call contains duplicate characters |
| 32 | + | |
| 33 | +10 | # PLE1310 |
| 34 | +11 | "Hello World".strip(r"Hello") |
| 35 | + | ^^^^^^^^ PLE1310 |
| 36 | +12 | |
| 37 | +13 | # PLE1310 |
| 38 | + | |
| 39 | + |
| 40 | +bad_str_strip_call.py:14:21: PLE1310 String `strip` call contains duplicate characters |
| 41 | + | |
| 42 | +13 | # PLE1310 |
| 43 | +14 | "Hello World".strip("Hello\t") |
| 44 | + | ^^^^^^^^^ PLE1310 |
| 45 | +15 | |
| 46 | +16 | # PLE1310 |
| 47 | + | |
| 48 | + |
| 49 | +bad_str_strip_call.py:17:21: PLE1310 String `strip` call contains duplicate characters |
| 50 | + | |
| 51 | +16 | # PLE1310 |
| 52 | +17 | "Hello World".strip(r"Hello\t") |
| 53 | + | ^^^^^^^^^^ PLE1310 |
| 54 | +18 | |
| 55 | +19 | # PLE1310 |
| 56 | + | |
| 57 | + |
| 58 | +bad_str_strip_call.py:20:21: PLE1310 String `strip` call contains duplicate characters |
| 59 | + | |
| 60 | +19 | # PLE1310 |
| 61 | +20 | "Hello World".strip("Hello\\") |
| 62 | + | ^^^^^^^^^ PLE1310 |
| 63 | +21 | |
| 64 | +22 | # PLE1310 |
| 65 | + | |
| 66 | + |
| 67 | +bad_str_strip_call.py:23:21: PLE1310 String `strip` call contains duplicate characters |
| 68 | + | |
| 69 | +22 | # PLE1310 |
| 70 | +23 | "Hello World".strip(r"Hello\\") |
| 71 | + | ^^^^^^^^^^ PLE1310 |
| 72 | +24 | |
| 73 | +25 | # PLE1310 |
| 74 | + | |
| 75 | + |
| 76 | +bad_str_strip_call.py:26:21: PLE1310 String `strip` call contains duplicate characters |
| 77 | + | |
| 78 | +25 | # PLE1310 |
| 79 | +26 | "Hello World".strip("🤣🤣🤣🤣🙃👀😀") |
| 80 | + | ^^^^^^^^^^^^^^^^ PLE1310 |
| 81 | +27 | |
| 82 | +28 | # PLE1310 |
| 83 | + | |
| 84 | + |
| 85 | +bad_str_strip_call.py:30:5: PLE1310 String `strip` call contains duplicate characters |
| 86 | + | |
| 87 | +28 | # PLE1310 |
| 88 | +29 | "Hello World".strip( |
| 89 | +30 | / """ |
| 90 | +31 | | there are a lot of characters to strip |
| 91 | +32 | | """ |
| 92 | + | |___^ PLE1310 |
| 93 | +33 | ) |
| 94 | + | |
| 95 | + |
| 96 | +bad_str_strip_call.py:36:21: PLE1310 String `strip` call contains duplicate characters |
| 97 | + | |
| 98 | +35 | # PLE1310 |
| 99 | +36 | "Hello World".strip("can we get a long " \ |
| 100 | + | _____________________^ |
| 101 | +37 | | "string of characters to strip " \ |
| 102 | +38 | | "please?") |
| 103 | + | |_____________________________^ PLE1310 |
| 104 | +39 | |
| 105 | +40 | # PLE1310 |
| 106 | + | |
| 107 | + |
| 108 | +bad_str_strip_call.py:42:5: PLE1310 String `strip` call contains duplicate characters |
| 109 | + | |
| 110 | +40 | # PLE1310 |
| 111 | +41 | "Hello World".strip( |
| 112 | +42 | / "can we get a long " |
| 113 | +43 | | "string of characters to strip " |
| 114 | +44 | | "please?" |
| 115 | + | |_____________^ PLE1310 |
| 116 | +45 | ) |
| 117 | + | |
| 118 | + |
| 119 | +bad_str_strip_call.py:49:5: PLE1310 String `strip` call contains duplicate characters |
| 120 | + | |
| 121 | +47 | # PLE1310 |
| 122 | +48 | "Hello World".strip( |
| 123 | +49 | / "can \t we get a long" |
| 124 | +50 | | "string \t of characters to strip" |
| 125 | +51 | | "please?" |
| 126 | + | |_____________^ PLE1310 |
| 127 | +52 | ) |
| 128 | + | |
| 129 | + |
| 130 | +bad_str_strip_call.py:61:11: PLE1310 String `strip` call contains duplicate characters |
| 131 | + | |
| 132 | +60 | # PLE1310 |
| 133 | +61 | u''.strip('http://') |
| 134 | + | ^^^^^^^^^ PLE1310 |
| 135 | +62 | |
| 136 | +63 | # PLE1310 |
| 137 | + | |
| 138 | + |
| 139 | +bad_str_strip_call.py:64:12: PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?) |
| 140 | + | |
| 141 | +63 | # PLE1310 |
| 142 | +64 | u''.lstrip('http://') |
| 143 | + | ^^^^^^^^^ PLE1310 |
| 144 | +65 | |
| 145 | +66 | # PLE1310 |
| 146 | + | |
| 147 | + |
| 148 | +bad_str_strip_call.py:67:12: PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?) |
| 149 | + | |
| 150 | +66 | # PLE1310 |
| 151 | +67 | b''.rstrip(b'http://') |
| 152 | + | ^^^^^^^^^^ PLE1310 |
| 153 | +68 | |
| 154 | +69 | # OK |
| 155 | + | |
| 156 | + |
| 157 | +bad_str_strip_call.py:79:10: PLE1310 String `strip` call contains duplicate characters |
| 158 | + | |
| 159 | +78 | # Errors: Multiple backslashes |
| 160 | +79 | ''.strip('\\b\\x09') |
| 161 | + | ^^^^^^^^^^ PLE1310 |
| 162 | +80 | ''.strip(r'\b\x09') |
| 163 | +81 | ''.strip('\\\x5C') |
| 164 | + | |
| 165 | + |
| 166 | +bad_str_strip_call.py:80:10: PLE1310 String `strip` call contains duplicate characters |
| 167 | + | |
| 168 | +78 | # Errors: Multiple backslashes |
| 169 | +79 | ''.strip('\\b\\x09') |
| 170 | +80 | ''.strip(r'\b\x09') |
| 171 | + | ^^^^^^^^^ PLE1310 |
| 172 | +81 | ''.strip('\\\x5C') |
| 173 | + | |
| 174 | + |
| 175 | +bad_str_strip_call.py:81:10: PLE1310 String `strip` call contains duplicate characters |
| 176 | + | |
| 177 | +79 | ''.strip('\\b\\x09') |
| 178 | +80 | ''.strip(r'\b\x09') |
| 179 | +81 | ''.strip('\\\x5C') |
| 180 | + | ^^^^^^^^ PLE1310 |
| 181 | +82 | |
| 182 | +83 | # Errors: Type inference |
| 183 | + | |
| 184 | + |
| 185 | +bad_str_strip_call.py:85:9: PLE1310 String `strip` call contains duplicate characters |
| 186 | + | |
| 187 | +83 | # Errors: Type inference |
| 188 | +84 | b = b'' |
| 189 | +85 | b.strip(b'//') |
| 190 | + | ^^^^^ PLE1310 |
| 191 | +86 | |
| 192 | +87 | # Errors: Type inference (preview) |
| 193 | + | |
| 194 | + |
| 195 | +bad_str_strip_call.py:89:12: PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?) |
| 196 | + | |
| 197 | +87 | # Errors: Type inference (preview) |
| 198 | +88 | foo: str = ""; bar: bytes = b"" |
| 199 | +89 | foo.rstrip("//") |
| 200 | + | ^^^^ PLE1310 |
| 201 | +90 | bar.lstrip(b"//") |
| 202 | + | |
| 203 | + |
| 204 | +bad_str_strip_call.py:90:12: PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?) |
| 205 | + | |
| 206 | +88 | foo: str = ""; bar: bytes = b"" |
| 207 | +89 | foo.rstrip("//") |
| 208 | +90 | bar.lstrip(b"//") |
| 209 | + | ^^^^^ PLE1310 |
| 210 | + | |
0 commit comments