MCPcopy Index your code
hub / github.com/Codeplain-ai/codeplain / validate_config

Function validate_config

plain2code_read_config.py:19–29  ·  view source on GitHub ↗

Validate the configuration against the parser.

(config: Dict[str, Any], parser: ArgumentParser)

Source from the content-addressed store, hash-verified

17
18
19def validate_config(config: Dict[str, Any], parser: ArgumentParser) -> None:
20 """Validate the configuration against the parser."""
21 actions = [action.dest for action in parser._actions]
22 for action in parser._actions:
23 if hasattr(action, "option_strings"):
24 actions.extend(opt.lstrip("-") for opt in action.option_strings)
25
26 for key in config.keys():
27 if key not in actions:
28 raise KeyError(f"Invalid configuration key: {key}")
29 return config
30
31
32def get_args_from_config(config_file: str, parser: ArgumentParser) -> Namespace:

Callers 1

get_args_from_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected