diff --git a/agent/registry.py b/agent/registry.py index f02cccb..ad93810 100644 --- a/agent/registry.py +++ b/agent/registry.py @@ -86,9 +86,9 @@ def make_tools() -> dict[str, Tool]: Dictionary mapping tool names to Tool objects """ # Import tools here to avoid circular dependencies - from .tools import api as api_tools - from .tools import filesystem as fs_tools - from .tools import language as lang_tools + from .tools import api as api_tools # noqa: PLC0415 + from .tools import filesystem as fs_tools # noqa: PLC0415 + from .tools import language as lang_tools # noqa: PLC0415 # List of all tool functions tool_functions = [ diff --git a/infrastructure/filesystem/organizer.py b/infrastructure/filesystem/organizer.py index da15357..60864ac 100644 --- a/infrastructure/filesystem/organizer.py +++ b/infrastructure/filesystem/organizer.py @@ -4,7 +4,8 @@ import logging from pathlib import Path from domain.movies.entities import Movie -from domain.tv_shows.entities import Episode, TVShow +from domain.tv_shows.entities import Episode, Season, TVShow +from domain.tv_shows.value_objects import SeasonNumber logger = logging.getLogger(__name__) @@ -74,8 +75,6 @@ class MediaOrganizer: show_dir = self.tvshow_folder / show_folder_name # Create season folder - from domain.tv_shows.entities import Season - season = Season( show_imdb_id=show.imdb_id, season_number=episode.season_number, @@ -124,9 +123,6 @@ class MediaOrganizer: Returns: True if successful """ - from domain.tv_shows.entities import Season - from domain.tv_shows.value_objects import SeasonNumber - show_folder_name = show.get_folder_name() show_dir = self.tvshow_folder / show_folder_name diff --git a/pyproject.toml b/pyproject.toml index 32df1d1..c4eb365 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,4 +110,8 @@ select = [ "PL", "UP", ] -ignore = ["PLR0913", "PLR2004"] +ignore = ["PLR0913", "PLR2004", "TID252", "E501"] + +[tool.ruff.per-file-ignores] +"tests/**/*.py" = ["PLC0415"] +"conftest.py" = ["PLC0415"] diff --git a/tests/test_registry_critical.py b/tests/test_registry_critical.py index 5b4e176..13de63d 100644 --- a/tests/test_registry_critical.py +++ b/tests/test_registry_critical.py @@ -187,17 +187,14 @@ class TestToolRegistry: for expected in expected_tools: assert expected in tools, f"Expected tool {expected} not registered" - def test_tool_functions_return_dict(self): - """Verify all tool functions return dictionaries.""" + def test_tool_functions_are_valid(self): + """Verify all tool functions are properly structured.""" tools = make_tools() - # Test with minimal valid arguments - # Note: This is a smoke test, not full integration + # Verify structure without calling functions + # (calling would require full setup with memory, clients, etc.) for name, tool in tools.items(): - sig = inspect.signature(tool.func) - # We can't call all tools without proper setup, - # but we can verify they're structured correctly - assert callable(tool.func) + assert callable(tool.func), f"Tool {name} function is not callable" class TestToolDataclass: