Skip to content

Commit

Permalink
ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Maffooch committed Jan 17, 2025
1 parent 94beccb commit 101555c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dojo/tools/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 failure on line 118 in dojo/tools/factory.py

View workflow job for this annotation

GitHub Actions / ruff-linting

Ruff (PTH208)

dojo/tools/factory.py:118:20: PTH208 Use `pathlib.Path.iterdir()` instead.
# check if it's dir
if Path(os.path.join(package_dir, module_name)).is_dir():
try:
Expand Down
1 change: 1 addition & 0 deletions unittests/test_copy_model.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion unittests/test_deduplication_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion unittests/test_duplication_loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion unittests/test_false_positive_history_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 101555c

Please sign in to comment.