Skip to content

Commit 021a299

Browse files
committed
style(cli): improve type hinting consistency in merge_json_files
1 parent 4da09b9 commit 021a299

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/specify_cli/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ def log(message, color="green"):
684684
shutil.copy2(sub_item, dest_file)
685685

686686

687-
def merge_json_files(existing_path: Path, new_content: Any, verbose: bool = False) -> Optional[dict]:
687+
def merge_json_files(existing_path: Path, new_content: Any, verbose: bool = False) -> Optional[dict[str, Any]]:
688688
"""Merge new JSON content into existing JSON file.
689689
690690
Performs a polite deep merge where:
@@ -732,7 +732,8 @@ def merge_json_files(existing_path: Path, new_content: Any, verbose: bool = Fals
732732
if verbose:
733733
console.print(f"[yellow]Warning: Existing JSON in {existing_path.name} is not an object. Skipping merge to avoid data loss.[/yellow]")
734734
return None
735-
def deep_merge_polite(base: dict, update: dict) -> dict:
735+
736+
def deep_merge_polite(base: dict[str, Any], update: dict[str, Any]) -> dict[str, Any]:
736737
"""Recursively merge update dict into base dict, preserving base values."""
737738
result = base.copy()
738739
for key, value in update.items():

0 commit comments

Comments
 (0)