Skip to content

Commit

Permalink
Ruff: Add and "fix" S104
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik committed Oct 14, 2024
1 parent 0bc4879 commit b0b86b0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dojo/tools/contrast/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_findings(self, filename, test):
finding.unsaved_endpoints = []
if row.get("Request URI"):
endpoint = Endpoint(
host="0.0.0.0",
host="0.0.0.0", # noqa: S104
path=row.get("Request URI"),
protocol=row.get("Request Protocol"),
)
Expand Down
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ select = [
"UP",
"YTT",
"ASYNC",
"S2", "S5", "S7",
"S104", "S2", "S5", "S7",
"FBT001", "FBT003",
"A003", "A004", "A006",
"COM",
Expand Down
2 changes: 1 addition & 1 deletion unittests/test_copy_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_duplicate_finding_with_endpoints(self):
product = self.create_product("test_deuplicate_finding", prod_type=product_type)
engagement = self.create_engagement("eng", product)
test = self.create_test(engagement=engagement, scan_type="NPM Audit Scan", title="test")
endpoint = Endpoint.from_uri("0.0.0.0")
endpoint = Endpoint.from_uri("0.0.0.0") # noqa: S104
endpoint.save()
finding = Finding.objects.create(test=test, reporter=user)
endpoint_status = Endpoint_Status.objects.create(finding=finding, endpoint=endpoint)
Expand Down
6 changes: 3 additions & 3 deletions unittests/tools/test_contrast_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_example_report(self):
self.assertEqual(1, len(finding.unsaved_endpoints))
endpoint = finding.unsaved_endpoints[0]
self.assertEqual("http", endpoint.protocol)
self.assertEqual("0.0.0.0", endpoint.host)
self.assertEqual("0.0.0.0", endpoint.host) # noqa: S104
self.assertEqual("WebGoat/login.mvc", endpoint.path)
with self.subTest(i=11):
finding = findings[11]
Expand All @@ -45,11 +45,11 @@ def test_example_report(self):
self.assertEqual(4, len(finding.unsaved_endpoints))
endpoint = finding.unsaved_endpoints[0]
self.assertEqual("http", endpoint.protocol)
self.assertEqual("0.0.0.0", endpoint.host)
self.assertEqual("0.0.0.0", endpoint.host) # noqa: S104
self.assertEqual("WebGoat/services/SoapRequest", endpoint.path)
endpoint = finding.unsaved_endpoints[1]
self.assertEqual("http", endpoint.protocol)
self.assertEqual("0.0.0.0", endpoint.host)
self.assertEqual("0.0.0.0", endpoint.host) # noqa: S104
self.assertEqual("WebGoat/attack", endpoint.path)

def test_example2_report(self):
Expand Down

0 comments on commit b0b86b0

Please sign in to comment.