MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / validate

Method validate

src/hooks/config_manager.py:351–374  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

349 return False
350
351 async def validate(self) -> list[HookValidationError]:
352 if not self._settings_path.exists():
353 return []
354
355 try:
356 data = json.loads(self._settings_path.read_text(encoding="utf-8"))
357 except (json.JSONDecodeError, OSError):
358 return [HookValidationError(
359 event="",
360 index=-1,
361 field="file",
362 message=f"Cannot read settings file: {self._settings_path}",
363 )]
364
365 hooks_raw = data.get("hooks", {})
366 if not isinstance(hooks_raw, dict):
367 return [HookValidationError(
368 event="",
369 index=-1,
370 field="hooks",
371 message="'hooks' field must be an object",
372 )]
373
374 return validate_hook_configs(hooks_raw)

Callers 7

test_validateMethod · 0.95
pickPresetFunction · 0.80
submitCustomFunction · 0.80
validatePairFunction · 0.80

Calls 3

HookValidationErrorClass · 0.85
validate_hook_configsFunction · 0.85
getMethod · 0.45

Tested by 2

test_validateMethod · 0.76