Skip to content

Commit 2dea573

Browse files
GWealecopybara-github
authored andcommitted
fix: add type hints in cleanup_unused_files.py
Updates type annotations to use built-in types like `list` and `dict`, and uses `| None` for optional types, along with adding `from __future__ import annotations` Co-authored-by: George Weale <gweale@google.com> PiperOrigin-RevId: 832522395
1 parent 871da73 commit 2dea573

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

contributing/samples/adk_agent_builder_assistant/tools/cleanup_unused_files.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414

1515
"""Cleanup unused files tool for Agent Builder Assistant."""
1616

17+
from __future__ import annotations
18+
1719
from typing import Any
18-
from typing import Dict
19-
from typing import List
20-
from typing import Optional
2120

2221
from google.adk.tools.tool_context import ToolContext
2322

@@ -26,11 +25,11 @@
2625

2726

2827
async def cleanup_unused_files(
29-
used_files: List[str],
28+
used_files: list[str],
3029
tool_context: ToolContext,
31-
file_patterns: Optional[List[str]] = None,
32-
exclude_patterns: Optional[List[str]] = None,
33-
) -> Dict[str, Any]:
30+
file_patterns: list[str] | None = None,
31+
exclude_patterns: list[str] | None = None,
32+
) -> dict[str, Any]:
3433
"""Identify and optionally delete unused files in project directories.
3534
3635
This tool helps clean up unused tool files when agent configurations change.

0 commit comments

Comments
 (0)