Skip to content

Commit 2f7b76e

Browse files
authored
Ruff: Add PLC28 and "fix" PLC28 (#11774)
1 parent 07b9ac3 commit 2f7b76e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

dojo/endpoint/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,12 @@ def endpoint_status_bulk_update(request, fid):
431431
finding__id=fid)
432432
for status in status_list:
433433
if status in enable:
434-
endpoint_status.__setattr__(status, True)
434+
endpoint_status.__setattr__(status, True) # noqa: PLC2801
435435
if status == "mitigated":
436436
endpoint_status.mitigated_by = request.user
437437
endpoint_status.mitigated_time = timezone.now()
438438
else:
439-
endpoint_status.__setattr__(status, False)
439+
endpoint_status.__setattr__(status, False) # noqa: PLC2801
440440
endpoint_status.last_modified = timezone.now()
441441
endpoint_status.save()
442442
messages.add_message(request,

dojo/tools/jfrog_xray_api_summary_artifact/parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,21 +184,21 @@ def decode_impact_path(path):
184184
if match:
185185
impact_path.sha = (match[1][:64]) if len(match[1]) > 64 else match[1]
186186

187-
if fullname.__contains__(".jar"):
187+
if ".jar" in fullname:
188188
match = re.match(r"(.*)-", fullname, re.IGNORECASE)
189189
if match:
190190
impact_path.name = match[1]
191191
match = re.match(r".*-(.*).jar", fullname, re.IGNORECASE)
192192
if match:
193193
impact_path.version = match[1]
194-
elif fullname.__contains__(":"):
194+
elif ":" in fullname:
195195
match = re.match(r"(.*):", fullname, re.IGNORECASE)
196196
if match:
197197
impact_path.name = match[1]
198198
match = re.match(r".*:(.*)", fullname, re.IGNORECASE)
199199
if match:
200200
impact_path.version = match[1]
201-
elif fullname.__contains__(".js"):
201+
elif ".js" in fullname:
202202
match = re.match(r"(.*)-", fullname, re.IGNORECASE)
203203
if match:
204204
impact_path.name = match[1]

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ select = [
7373
"FIX",
7474
"PD",
7575
"PGH",
76-
"PLC01", "PLC0205", "PLC0208", "PLC0414", "PLC18", "PLC24", "PLC3",
76+
"PLC01", "PLC0205", "PLC0208", "PLC0414", "PLC18", "PLC24", "PLC28", "PLC3",
7777
"PLE",
7878
"PLR01", "PLR02", "PLR04", "PLR0915", "PLR1716", "PLR172", "PLR1733", "PLR1736", "PLR5", "PLR6104", "PLR6201",
7979
"PLW01", "PLW02", "PLW04", "PLW07", "PLW1", "PLW2", "PLW3",

0 commit comments

Comments
 (0)