1616import re
1717from datetime import datetime
1818import logging
19+ from typing import Dict , List , Any , Optional
1920
2021
21- def load_known_good (path ) :
22+ def load_known_good (path : str ) -> Dict [ str , Any ] :
2223 """Load and parse the known_good.json file."""
2324 with open (path , "r" , encoding = "utf-8" ) as f :
2425 data = json .load (f )
@@ -31,7 +32,7 @@ def load_known_good(path):
3132 )
3233
3334
34- def generate_git_override_blocks (modules_dict , repo_commit_dict ) :
35+ def generate_git_override_blocks (modules_dict : Dict [ str , Any ], repo_commit_dict : Dict [ str , str ]) -> List [ str ] :
3536 """Generate bazel_dep and git_override blocks for each module."""
3637 blocks = []
3738
@@ -90,7 +91,7 @@ def generate_git_override_blocks(modules_dict, repo_commit_dict):
9091 return blocks
9192
9293
93- def generate_file_content (modules , repo_commit_dict , timestamp = None ):
94+ def generate_file_content (modules : Dict [ str , Any ], repo_commit_dict : Dict [ str , str ], timestamp : Optional [ str ] = None ) -> str :
9495 """Generate the complete content for score_modules.MODULE.bazel."""
9596 # License header assembled with parenthesis grouping (no indentation preserved in output).
9697 header = (
@@ -124,7 +125,7 @@ def generate_file_content(modules, repo_commit_dict, timestamp=None):
124125 return header + "\n " .join (blocks )
125126
126127
127- def main ():
128+ def main () -> None :
128129 parser = argparse .ArgumentParser (
129130 description = "Generate score_modules.MODULE.bazel from known_good.json"
130131 )
0 commit comments