MCPcopy Index your code
hub / github.com/github/spec-kit / _register_step

Function _register_step

src/specify_cli/workflows/__init__.py:25–35  ·  view source on GitHub ↗

Register a step type instance in the global registry. Raises ``ValueError`` for falsy keys and ``KeyError`` for duplicates.

(step: StepBase)

Source from the content-addressed store, hash-verified

23
24
25def _register_step(step: StepBase) -> None:
26 """Register a step type instance in the global registry.
27
28 Raises ``ValueError`` for falsy keys and ``KeyError`` for duplicates.
29 """
30 key = step.type_key
31 if not key:
32 raise ValueError("Cannot register step type with an empty type_key.")
33 if key in STEP_REGISTRY:
34 raise KeyError(f"Step type with key {key!r} is already registered.")
35 STEP_REGISTRY[key] = step
36
37
38def get_step_type(type_key: str) -> StepBase | None:

Calls

no outgoing calls