diff --git a/dojo/utils.py b/dojo/utils.py index 65d6bdf728..0e340f2ce0 100644 --- a/dojo/utils.py +++ b/dojo/utils.py @@ -2222,7 +2222,7 @@ def mass_model_updater(model_type, models, function, fields, page_size=1000, ord def to_str_typed(obj): - """for code that handles multiple types of objects, print not only __str__ but prefix the type of the object""" + """For code that handles multiple types of objects, print not only __str__ but prefix the type of the object""" return f"{type(obj)}: {obj}" diff --git a/ruff.toml b/ruff.toml index 25e456a548..ac0f0ece1e 100644 --- a/ruff.toml +++ b/ruff.toml @@ -37,7 +37,7 @@ select = [ "W", "C90", "I", - "D2", "D3", + "D2", "D3", "D403", "UP", "YTT", "ASYNC", diff --git a/unittests/test_apiv2_notifications.py b/unittests/test_apiv2_notifications.py index d24a05f596..09d57dfd9f 100644 --- a/unittests/test_apiv2_notifications.py +++ b/unittests/test_apiv2_notifications.py @@ -57,7 +57,7 @@ def test_notification_template_multiple(self): self.assertEqual("Notification template already exists", r.json()["non_field_errors"][0]) def test_user_notifications(self): - """creates user and checks if template is assigned""" + """Creates user and checks if template is assigned""" user = {"user": self.create_test_user()} r = self.client.get(reverse("notifications-list"), user, format="json") self.assertEqual(r.status_code, 200) diff --git a/unittests/tools/test_github_vulnerability_parser.py b/unittests/tools/test_github_vulnerability_parser.py index c0c9a0350e..00321647bf 100644 --- a/unittests/tools/test_github_vulnerability_parser.py +++ b/unittests/tools/test_github_vulnerability_parser.py @@ -9,14 +9,14 @@ class TestGithubVulnerabilityParser(DojoTestCase): def test_parse_file_with_no_vuln_has_no_findings(self): - """sample with zero vulnerability""" + """Sample with zero vulnerability""" with open("unittests/scans/github_vulnerability/github-0-vuln.json", encoding="utf-8") as testfile: parser = GithubVulnerabilityParser() findings = parser.get_findings(testfile, Test()) self.assertEqual(0, len(findings)) def test_parse_file_with_one_vuln_has_one_findings(self): - """sample with one vulnerability""" + """Sample with one vulnerability""" with open("unittests/scans/github_vulnerability/github-1-vuln.json", encoding="utf-8") as testfile: parser = GithubVulnerabilityParser() findings = parser.get_findings(testfile, Test()) @@ -36,7 +36,7 @@ def test_parse_file_with_one_vuln_has_one_findings(self): self.assertEqual(finding.unique_id_from_tool, "aabbccddeeff1122334401") def test_parse_file_with_one_vuln_has_one_finding_and_dependabot_direct_link(self): - """sample with one vulnerability""" + """Sample with one vulnerability""" with open("unittests/scans/github_vulnerability/github-1-vuln-repo-dependabot-link.json", encoding="utf-8") as testfile: parser = GithubVulnerabilityParser() findings = parser.get_findings(testfile, Test()) @@ -56,7 +56,7 @@ def test_parse_file_with_one_vuln_has_one_finding_and_dependabot_direct_link(sel self.assertEqual(finding.unique_id_from_tool, "aabbccddeeff1122334401") def test_parse_file_with_multiple_vuln_has_multiple_findings(self): - """sample with five vulnerability""" + """Sample with five vulnerability""" with open("unittests/scans/github_vulnerability/github-5-vuln.json", encoding="utf-8") as testfile: parser = GithubVulnerabilityParser() findings = parser.get_findings(testfile, Test()) diff --git a/unittests/tools/test_sarif_parser.py b/unittests/tools/test_sarif_parser.py index 0ae50e659f..aafa91d09e 100644 --- a/unittests/tools/test_sarif_parser.py +++ b/unittests/tools/test_sarif_parser.py @@ -28,7 +28,7 @@ def test_example_report(self): self.common_checks(finding) def test_suppression_report(self): - """test report file having different suppression definitions""" + """Test report file having different suppression definitions""" with open(path.join(path.dirname(__file__), "../scans/sarif/suppression_test.sarif"), encoding="utf-8") as testfile: parser = SarifParser() findings = parser.get_findings(testfile, Test()) diff --git a/unittests/tools/test_sonarqube_parser.py b/unittests/tools/test_sonarqube_parser.py index 16b80aa9eb..ef4912510b 100644 --- a/unittests/tools/test_sonarqube_parser.py +++ b/unittests/tools/test_sonarqube_parser.py @@ -245,7 +245,7 @@ def test_detailed_parse_file_with_table_in_table(self): my_file_handle.close() def test_detailed_parse_file_with_rule_undefined(self): - """the vulnerability's rule is not in the list of rules""" + """The vulnerability's rule is not in the list of rules""" my_file_handle, _product, _engagement, test = self.init( get_unit_tests_path() + "/scans/sonarqube/sonar-rule-undefined.html", ) diff --git a/unittests/tools/test_tenable_parser.py b/unittests/tools/test_tenable_parser.py index 7be782c49e..cde5119fe9 100644 --- a/unittests/tools/test_tenable_parser.py +++ b/unittests/tools/test_tenable_parser.py @@ -155,7 +155,7 @@ def test_parse_some_findings_samples_nessus_legacy(self): self.assertEqual("CVE-2005-1794", vulnerability_id) def test_parse_some_findings_with_cvssv3_nessus_legacy(self): - """test with cvssv3""" + """Test with cvssv3""" with open(path.join(path.dirname(__file__), "../scans/tenable/nessus/nessus_with_cvssv3.nessus"), encoding="utf-8") as testfile: parser = TenableParser() findings = parser.get_findings(testfile, self.create_test())