Skip to content

Commit d39dfdd

Browse files
Fix pyink formatting and isort
1 parent 0e0f6d6 commit d39dfdd

4 files changed

Lines changed: 8 additions & 13 deletions

File tree

contributing/samples/gepa/experiment.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
from tau_bench.types import EnvRunResult
4444
from tau_bench.types import RunConfig
4545
import tau_bench_agent as tau_bench_agent_lib
46-
4746
import utils
4847

4948

contributing/samples/gepa/run_experiment.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from absl import flags
2626
import experiment
2727
from google.genai import types
28-
2928
import utils
3029

3130
_OUTPUT_DIR = flags.DEFINE_string(

src/google/adk/skills/_utils.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
"""Utility functions for Agent Skills."""
1616

1717
from __future__ import annotations
18-
import os
18+
1919
import logging
20+
import os
2021
import pathlib
2122
from typing import Union
2223

@@ -407,7 +408,7 @@ def _load_files_in_dir(subdir: str) -> dict[str, str | bytes]:
407408
result = {}
408409

409410
for blob in blobs:
410-
relative_path = blob.name[len(prefix):]
411+
relative_path = blob.name[len(prefix) :]
411412
if not relative_path:
412413
continue
413414

@@ -416,17 +417,13 @@ def _load_files_in_dir(subdir: str) -> dict[str, str | bytes]:
416417

417418
# Reject absolute paths and traversal sequences
418419
if p.is_absolute() or ".." in p.parts:
419-
raise ValueError(
420-
f"Unsafe path in skill resource: {relative_path!r}"
421-
)
420+
raise ValueError(f"Unsafe path in skill resource: {relative_path!r}")
422421

423422
normalized = p.as_posix()
424423

425424
# Prevent silent file overwrites via path aliasing
426425
if normalized in result:
427-
raise ValueError(
428-
f"Duplicate normalized path detected: {normalized!r}"
429-
)
426+
raise ValueError(f"Duplicate normalized path detected: {normalized!r}")
430427

431428
# NOTE: Final path safety enforced during materialization
432429
# via realpath + commonpath checks in skill_toolset.py

src/google/adk/tools/skill_toolset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ def _build_wrapper_code(
520520
)
521521

522522
# Build the boilerplate extract string
523-
523+
524524
code_lines = [
525525
"import os",
526526
"import tempfile",
@@ -534,8 +534,8 @@ def _build_wrapper_code(
534534
" with tempfile.TemporaryDirectory() as td:",
535535
" _real_base = os.path.realpath(td)",
536536
" for rel_path, content in _files.items():",
537-
" if os.path.isabs(rel_path):",
538-
" raise ValueError(f'Absolute path rejected: {rel_path!r}')",
537+
" if os.path.isabs(rel_path):",
538+
" raise ValueError(f'Absolute path rejected: {rel_path!r}')",
539539
" _safe = os.path.realpath(os.path.join(td, rel_path))",
540540
" if os.path.commonpath([_real_base, _safe]) != _real_base:",
541541
" raise ValueError(f'Path traversal detected: {rel_path!r}')",

0 commit comments

Comments
 (0)