Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Scripts/deduplicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from collections.abc import Iterable

# Add current directory to path to allow importing common if run from elsewhere
if str(Path(__file__).parent) not in sys.path:
sys.path.append(str(Path(__file__).parent))

from common import is_valid_domain, write_lines
Comment on lines 16 to 18
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment about adding the script directory to sys.path is now stale since the sys.path modification was removed. Please remove or update this comment to avoid misleading future readers.

Copilot uses AI. Check for mistakes.

Expand Down
2 changes: 0 additions & 2 deletions Scripts/move-pure-domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from collections import defaultdict

# Import common utilities
if str(Path(__file__).parent) not in sys.path:
sys.path.append(str(Path(__file__).parent))

from common import is_valid_domain, read_lines, write_lines

Expand Down
3 changes: 0 additions & 3 deletions Scripts/test_common.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import unittest
import sys
from pathlib import Path
import hashlib

# Add current directory to path
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Orphaned comment - the sys.path manipulation code this comment referred to has been removed. This comment is now misleading and should be removed.

if str(Path(__file__).parent) not in sys.path:
sys.path.append(str(Path(__file__).parent))

from common import sanitize_filename, is_valid_domain, is_adguard_rule
Comment on lines 5 to 7
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Add current directory to path" comment is now inaccurate after removing the sys.path modification. Please remove/update it to prevent confusion about how common is imported in tests.

Copilot uses AI. Check for mistakes.

Expand Down
4 changes: 0 additions & 4 deletions Scripts/test_deduplicate.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import unittest
import sys
from pathlib import Path

# Add current directory to path to allow importing deduplicate
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Orphaned comment - the sys.path manipulation code this comment referred to has been removed. This comment is now misleading and should be removed.

if str(Path(__file__).parent) not in sys.path:
sys.path.append(str(Path(__file__).parent))

from deduplicate import process_content
Comment on lines 3 to 5
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment indicates the test adjusts sys.path, but that code was removed. Please delete or reword the comment so it matches the current import strategy (relying on unittest discover adding Scripts/ to sys.path).

Copilot uses AI. Check for mistakes.

Expand Down
7 changes: 0 additions & 7 deletions Scripts/test_is_pure_domain_logic.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import unittest
import sys
from pathlib import Path
import importlib

# Add Scripts to path
scripts_dir = Path(__file__).parent
if str(scripts_dir) not in sys.path:
sys.path.append(str(scripts_dir))

# Import ADGUARD_INDICATORS from common
from common import ADGUARD_INDICATORS

Expand Down
4 changes: 3 additions & 1 deletion Scripts/test_update_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class ClientError(Exception):
sys.modules["aiohttp"] = aiohttp_mock
sys.modules["aiofiles"] = MagicMock()

spec = importlib.util.spec_from_file_location("update_lists", "Scripts/update-lists.py")
spec = importlib.util.spec_from_file_location(
"update_lists", str(Path(__file__).parent / "update-lists.py")
)
update_lists = importlib.util.module_from_spec(spec)
sys.modules["update_lists"] = update_lists
spec.loader.exec_module(update_lists)
Expand Down
2 changes: 0 additions & 2 deletions Scripts/update-lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import aiofiles

# Import common utilities
if str(Path(__file__).parent) not in sys.path:
sys.path.append(str(Path(__file__).parent))

from common import sanitize_filename

Expand Down
Loading