Skip to content

Commit c9d0896

Browse files
Ruff: Add B018 rule (#12110)
* Ruff: Add B018 rule * update * fix
1 parent 4d2cafc commit c9d0896

File tree

7 files changed

+3
-15
lines changed

7 files changed

+3
-15
lines changed

dojo/management/commands/jira_status_reconciliation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ def jira_status_reconciliation(*args, **kwargs):
7575
# convert from str to datetime
7676
issue_from_jira.fields.updated = parse_datetime(issue_from_jira.fields.updated)
7777

78-
find.jira_issue.jira_change, issue_from_jira.fields.updated, find.last_status_update, issue_from_jira.fields.updated, find.last_reviewed, issue_from_jira.fields.updated
79-
8078
flag1, flag2, flag3 = None, None, None
8179

8280
if mode == "reconcile" and not find.last_status_update:

dojo/templatetags/display_tags.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,11 +1013,6 @@ def import_history(finding, *, autoescape=True):
10131013
if not finding or not settings.TRACK_IMPORT_HISTORY:
10141014
return ""
10151015

1016-
if autoescape:
1017-
conditional_escape
1018-
else:
1019-
lambda x: x
1020-
10211016
# prefetched, so no filtering here
10221017
status_changes = finding.test_import_finding_action_set.all()
10231018

dojo/tools/checkmarx/parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ def _get_findings_xml(self, filename, test):
171171
# consolidate vuln_ids_from_tool values
172172
if self.mode != "detailed":
173173
for key in list(dupes):
174-
vuln_ids_from_tool[key].sort
175174
dupes[key].vuln_id_from_tool = ",".join(
176175
vuln_ids_from_tool[key],
177176
)[:500]

dojo/tools/risk_recon/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _get_findings_internal(self, findings, test):
110110

111111
if dupe_key in dupes:
112112
find = dupes[dupe_key]
113-
find.nb_occurences
113+
find.nb_occurences += 1
114114
else:
115115
dupes[dupe_key] = finding
116116

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ select = [
8888
"FURB",
8989
"DOC202", "DOC403", "DOC502",
9090
"RUF",
91-
"B00", "B010", "B011", "B012", "B013", "B014", "B015", "B016", "B017", "B019", "B020", "B021", "B022", "B023", "B025", "B028", "B029", "B03", "B901", "B903", "B905", "B911",
91+
"B00", "B010", "B011", "B012", "B013", "B014", "B015", "B016", "B017", "B018", "B019", "B020", "B021", "B022", "B023", "B025", "B028", "B029", "B03", "B901", "B903", "B905", "B911",
9292
"PERF1", "PERF2",
9393
]
9494
ignore = [

tests/finding_test.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,6 @@ def test_simple_accept_finding(self):
312312
self.goto_all_findings_list(driver)
313313
# Select and click on the particular finding to edit
314314
driver.find_element(By.LINK_TEXT, "App Vulnerable to XSS").click()
315-
# Get the status of the current endpoint
316-
driver.find_element(By.XPATH, '//*[@id="vuln_endpoints"]/tbody/tr/td[3]').text
317315
# Click on the 'dropdownMenu1 button'
318316
driver.find_element(By.ID, "dropdownMenu1").click()
319317
# Click on `Close Finding`
@@ -336,8 +334,6 @@ def test_unaccept_finding(self):
336334
self.goto_all_findings_list(driver)
337335
# Select and click on the particular finding to edit
338336
driver.find_element(By.LINK_TEXT, "App Vulnerable to XSS").click()
339-
# Get the status of the current endpoint
340-
driver.find_element(By.XPATH, '//*[@id="remd_endpoints"]/tbody/tr/td[3]').text
341337
# Click on the 'dropdownMenu1 button'
342338
driver.find_element(By.ID, "dropdownMenu1").click()
343339
# Click on `Close Finding`

wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
application = get_wsgi_application()
3333

3434
# Preload the application code by preloading the URLs configuration
35-
get_resolver(ROOT_URLCONF).url_patterns
35+
get_resolver(ROOT_URLCONF).url_patterns # noqa: B018

0 commit comments

Comments
 (0)