From 101555cdc81c8a864a9363fd3f96d92086ea6675 Mon Sep 17 00:00:00 2001 From: Cody Maffucci <46459665+Maffooch@users.noreply.github.com> Date: Fri, 17 Jan 2025 17:21:57 -0600 Subject: [PATCH] ruff fixes --- dojo/tools/factory.py | 2 +- unittests/test_copy_model.py | 1 + unittests/test_deduplication_logic.py | 12 +++++++++++- unittests/test_duplication_loops.py | 2 +- unittests/test_false_positive_history_logic.py | 12 +++++++++++- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/dojo/tools/factory.py b/dojo/tools/factory.py index b69fea12ac0..04930321c50 100644 --- a/dojo/tools/factory.py +++ b/dojo/tools/factory.py @@ -115,7 +115,7 @@ def requires_tool_type(scan_type): # iterate through the modules in the current package package_dir = str(Path(__file__).resolve().parent) -for module_name in os.listdir(package_dir): # noqa: PTH208 +for module_name in os.listdir(package_dir): # check if it's dir if Path(os.path.join(package_dir, module_name)).is_dir(): try: diff --git a/unittests/test_copy_model.py b/unittests/test_copy_model.py index 8b333e3f0c4..f14e7091e32 100644 --- a/unittests/test_copy_model.py +++ b/unittests/test_copy_model.py @@ -1,4 +1,5 @@ from django.db import models + from dojo.models import Endpoint, Endpoint_Status, Engagement, Finding, Product, Test, User from .dojo_test_case import DojoTestCase diff --git a/unittests/test_deduplication_logic.py b/unittests/test_deduplication_logic.py index 7d73ea329b1..b3e9372a54a 100644 --- a/unittests/test_deduplication_logic.py +++ b/unittests/test_deduplication_logic.py @@ -4,7 +4,17 @@ from crum import impersonate from django.conf import settings -from dojo.models import Endpoint, Endpoint_Status, Engagement, Finding, Product, System_Settings, Test, User, _copy_model_util +from dojo.models import ( + Endpoint, + Endpoint_Status, + Engagement, + Finding, + Product, + System_Settings, + Test, + User, + _copy_model_util, +) from .dojo_test_case import DojoTestCase diff --git a/unittests/test_duplication_loops.py b/unittests/test_duplication_loops.py index a2f1495fb90..cc0d250774e 100644 --- a/unittests/test_duplication_loops.py +++ b/unittests/test_duplication_loops.py @@ -4,7 +4,7 @@ from django.test.utils import override_settings from dojo.management.commands.fix_loop_duplicates import fix_loop_duplicates -from dojo.models import Engagement, Finding, Product, User, _copy_model_util +from dojo.models import Engagement, Finding, Product, User, _copy_model_util from dojo.utils import set_duplicate from .dojo_test_case import DojoTestCase diff --git a/unittests/test_false_positive_history_logic.py b/unittests/test_false_positive_history_logic.py index 2ea8fcef645..6af91445fa6 100644 --- a/unittests/test_false_positive_history_logic.py +++ b/unittests/test_false_positive_history_logic.py @@ -3,7 +3,17 @@ from crum import impersonate -from dojo.models import Endpoint, Endpoint_Status, Engagement, Finding, Product, System_Settings, Test, User, _copy_model_util +from dojo.models import ( + Endpoint, + Endpoint_Status, + Engagement, + Finding, + Product, + System_Settings, + Test, + User, + _copy_model_util, +) from .dojo_test_case import DojoTestCase