Skip to content

Commit 70b1c91

Browse files
committed
Ruff: fix Q003
1 parent e7fdb13 commit 70b1c91

File tree

12 files changed

+18
-18
lines changed

12 files changed

+18
-18
lines changed

dojo/filters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ class FindingFilterHelper(FilterSet):
16151615
"The range of EPSS score percentages to filter on; the left input is a lower bound, "
16161616
"the right is an upper bound. Leaving one empty will skip that bound (e.g., leaving "
16171617
"the lower bound input empty will filter only on the upper bound -- filtering on "
1618-
"\"less than or equal\")."
1618+
'"less than or equal").'
16191619
))
16201620
epss_percentile = PercentageFilter(field_name="epss_percentile", label="EPSS percentile")
16211621
epss_percentile_range = PercentageRangeFilter(
@@ -1624,7 +1624,7 @@ class FindingFilterHelper(FilterSet):
16241624
help_text=(
16251625
"The range of EPSS percentiles to filter on; the left input is a lower bound, the right "
16261626
"is an upper bound. Leaving one empty will skip that bound (e.g., leaving the lower bound "
1627-
"input empty will filter only on the upper bound -- filtering on \"less than or equal\")."
1627+
'input empty will filter only on the upper bound -- filtering on "less than or equal").'
16281628
))
16291629

16301630
o = OrderingFilter(

dojo/finding/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,7 @@ def request_finding_review(request, fid):
17091709
finding=finding,
17101710
reviewers=reviewers,
17111711
recipients=reviewers_usernames,
1712-
description=f"User {user.get_full_name()} has requested that user(s) {reviewers_string} review the finding \"{finding.title}\" for accuracy:\n\n{new_note}",
1712+
description=f'User {user.get_full_name()} has requested that user(s) {reviewers_string} review the finding "{finding.title}" for accuracy:\n\n{new_note}',
17131713
icon="check",
17141714
url=reverse("view_finding", args=(finding.id,)),
17151715
)

dojo/jira_link/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def post(self, request, tid=None):
544544
create_notification(
545545
event='jira_config_deleted',
546546
title=_('Deletion of JIRA: %s') % jira_instance.configuration_name,
547-
description=f"JIRA \"{jira_instance.configuration_name}\" was deleted by {request.user}",
547+
description=f'JIRA "{jira_instance.configuration_name}" was deleted by {request.user}',
548548
url=request.build_absolute_uri(reverse('jira')))
549549
return HttpResponseRedirect(reverse('jira'))
550550
except Exception as e:

dojo/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3908,7 +3908,7 @@ class JIRA_Project(models.Model):
39083908
engagement = models.OneToOneField(Engagement, on_delete=models.CASCADE, null=True, blank=True)
39093909
component = models.CharField(max_length=200, blank=True)
39103910
custom_fields = models.JSONField(max_length=200, blank=True, null=True,
3911-
help_text=_("JIRA custom field JSON mapping of Id to value, e.g. {\"customfield_10122\": [{\"name\": \"8.0.1\"}]}"))
3911+
help_text=_('JIRA custom field JSON mapping of Id to value, e.g. {"customfield_10122": [{"name": "8.0.1"}]}'))
39123912
default_assignee = models.CharField(max_length=200, blank=True, null=True,
39133913
help_text=_("JIRA default assignee (name). If left blank then it defaults to whatever is configured in JIRA."))
39143914
jira_labels = models.CharField(max_length=200, blank=True, null=True,

dojo/sla_config/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def edit_sla_config(request, slaid):
4242
if request.method == 'POST' and request.POST.get('delete'):
4343
if sla_config.id != 1:
4444
if Product.objects.filter(sla_configuration=sla_config).count():
45-
msg = f"The \"{sla_config}\" SLA configuration could not be deleted, as it is currently in use by one or more products."
45+
msg = f'The "{sla_config}" SLA configuration could not be deleted, as it is currently in use by one or more products.'
4646
messages.add_message(request,
4747
messages.ERROR,
4848
msg,

dojo/templatetags/display_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def notspecified(text):
378378
if text:
379379
return text
380380
else:
381-
return mark_safe("<em class=\"text-muted\">Not Specified</em>")
381+
return mark_safe('<em class="text-muted">Not Specified</em>')
382382

383383

384384
@register.tag

dojo/tools/api_sonarqube/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def get_issue(self, issue_key):
265265
if issue["key"] == issue_key:
266266
return issue
267267
msg = (
268-
f"Expected Issue \"{issue_key}\", but it returned"
268+
f'Expected Issue "{issue_key}", but it returned'
269269
f"{[x.get('key') for x in response.json().get('issues')]}. "
270270
"Full response: "
271271
f"{response.json()}"

unittests/tools/test_mozilla_observatory_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_parse_file_cli_juicy(self):
105105
elif "subresource-integrity" == finding.vuln_id_from_tool:
106106
with self.subTest(vuln_id_from_tool=finding.vuln_id_from_tool):
107107
self.assertTrue(finding.active)
108-
self.assertEqual("Subresource Integrity (SRI) not implemented, and external scripts are loaded over HTTP or use protocol-relative URLs via src=\"//...\"", finding.title)
108+
self.assertEqual('Subresource Integrity (SRI) not implemented, and external scripts are loaded over HTTP or use protocol-relative URLs via src="//..."', finding.title)
109109
self.assertEqual("High", finding.severity)
110110
self.assertIn("Subresource Integrity (SRI) not implemented", finding.description)
111111
elif "redirection" == finding.vuln_id_from_tool:
@@ -158,7 +158,7 @@ def test_parse_file_cli_nmap_scanme(self):
158158
elif "subresource-integrity" == finding.vuln_id_from_tool:
159159
with self.subTest(vuln_id_from_tool=finding.vuln_id_from_tool):
160160
self.assertTrue(finding.active)
161-
self.assertEqual("Subresource Integrity (SRI) not implemented, and external scripts are loaded over HTTP or use protocol-relative URLs via src=\"//...\"", finding.title)
161+
self.assertEqual('Subresource Integrity (SRI) not implemented, and external scripts are loaded over HTTP or use protocol-relative URLs via src="//..."', finding.title)
162162
self.assertEqual("High", finding.severity)
163163
self.assertIn("Subresource Integrity (SRI) not implemented", finding.description)
164164
elif "redirection" == finding.vuln_id_from_tool:

unittests/tools/test_nexpose_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def test_nexpose_parser_has_many_finding(self):
6464

6565
# vuln 5
6666
finding = findings[5]
67-
self.assertEqual("Default SSH password: root password \"root\"", finding.title)
67+
self.assertEqual('Default SSH password: root password "root"', finding.title)
6868
self.assertEqual(1, len(finding.unsaved_endpoints))
6969

7070
# vuln 5 - endpoint

unittests/tools/test_nikto_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_parse_file_xml_another(self):
165165
self.assertIsNone(endpoint.path)
166166
with self.subTest(i=5):
167167
finding = findings[5]
168-
self.assertEqual("The Content-Encoding header is set to \"deflate\" this may mean that the server is vulnerable to the BREACH attack.", finding.title)
168+
self.assertEqual('The Content-Encoding header is set to "deflate" this may mean that the server is vulnerable to the BREACH attack.', finding.title)
169169
self.assertEqual("999966", finding.vuln_id_from_tool)
170170
self.assertEqual(1, finding.nb_occurences)
171171
self.assertEqual("Info", finding.severity)

unittests/tools/test_qualys_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def test_parse_file_with_cvss_values_and_scores(self):
153153
finding_cvssv3_score = finding
154154
if finding.unsaved_endpoints[0].host == "demo13.s02.sjc01.qualys.com" and finding.title == "QID-370876 | AMD Processors Multiple Security Vulnerabilities (RYZENFALL/MASTERKEY/CHIMERA-FW/FALLOUT)":
155155
finding_no_cvssv3_at_detection = finding
156-
if finding.unsaved_endpoints[0].host == "demo14.s02.sjc01.qualys.com" and finding.title == "QID-121695 | NTP \"monlist\" Feature Denial of Service Vulnerability":
156+
if finding.unsaved_endpoints[0].host == "demo14.s02.sjc01.qualys.com" and finding.title == 'QID-121695 | NTP "monlist" Feature Denial of Service Vulnerability':
157157
finding_no_cvssv3 = finding
158158
# The CVSS Vector is not used from the Knowledgebase
159159
self.assertEqual(

unittests/tools/test_semgrep_parser.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ def test_parse_one_finding(self):
2121
self.assertEqual("src/main/java/org/owasp/benchmark/testcode/BenchmarkTest02194.java", finding.file_path)
2222
self.assertEqual(64, finding.line)
2323
self.assertEqual(696, finding.cwe)
24-
self.assertEqual("javax crypto Cipher.getInstance(\"AES/GCM/NoPadding\");", finding.mitigation)
24+
self.assertEqual('javax crypto Cipher.getInstance("AES/GCM/NoPadding");', finding.mitigation)
2525
self.assertEqual("java.lang.security.audit.cbc-padding-oracle.cbc-padding-oracle", finding.vuln_id_from_tool)
26-
self.assertIn("javax.crypto.Cipher c = javax.crypto.Cipher.getInstance(\"DES/CBC/PKCS5Padding\");", finding.description)
26+
self.assertIn('javax.crypto.Cipher c = javax.crypto.Cipher.getInstance("DES/CBC/PKCS5Padding");', finding.description)
2727
self.assertIn("Using CBC with PKCS5Padding is susceptible to padding orcale attacks", finding.description)
2828

2929
def test_parse_many_finding(self):
@@ -36,14 +36,14 @@ def test_parse_many_finding(self):
3636
self.assertEqual("src/main/java/org/owasp/benchmark/testcode/BenchmarkTest02194.java", finding.file_path)
3737
self.assertEqual(64, finding.line)
3838
self.assertEqual(696, finding.cwe)
39-
self.assertEqual("javax crypto Cipher.getInstance(\"AES/GCM/NoPadding\");", finding.mitigation)
39+
self.assertEqual('javax crypto Cipher.getInstance("AES/GCM/NoPadding");', finding.mitigation)
4040
self.assertEqual("java.lang.security.audit.cbc-padding-oracle.cbc-padding-oracle", finding.vuln_id_from_tool)
4141
finding = findings[2]
4242
self.assertEqual("Info", finding.severity)
4343
self.assertEqual("src/main/java/org/owasp/benchmark/testcode/BenchmarkTest01150.java", finding.file_path)
4444
self.assertEqual(66, finding.line)
4545
self.assertEqual(696, finding.cwe)
46-
self.assertEqual("javax crypto Cipher.getInstance(\"AES/GCM/NoPadding\");", finding.mitigation)
46+
self.assertEqual('javax crypto Cipher.getInstance("AES/GCM/NoPadding");', finding.mitigation)
4747
self.assertEqual("java.lang.security.audit.cbc-padding-oracle.cbc-padding-oracle", finding.vuln_id_from_tool)
4848

4949
def test_parse_repeated_finding(self):
@@ -57,7 +57,7 @@ def test_parse_repeated_finding(self):
5757
self.assertEqual(66, finding.line)
5858
self.assertEqual("java.lang.security.audit.cbc-padding-oracle.cbc-padding-oracle", finding.vuln_id_from_tool)
5959
self.assertEqual(696, finding.cwe)
60-
self.assertEqual("javax crypto Cipher.getInstance(\"AES/GCM/NoPadding\");", finding.mitigation)
60+
self.assertEqual('javax crypto Cipher.getInstance("AES/GCM/NoPadding");', finding.mitigation)
6161
self.assertEqual(2, finding.nb_occurences)
6262

6363
def test_parse_many_vulns(self):

0 commit comments

Comments
 (0)