Module

services.validation

Validation service protocol and implementations.

Provides protocol-based validation service interface with default implementation. Enables decoupled validation logic that can be swapped for different validation strategies or testing.

Key Concepts:

  • Validation protocol: Protocol-based interface for validation services
  • Template validation: Template rendering validation
  • Service pattern: Decoupled validation logic
  • Default implementation: DefaultTemplateValidationService adapter

Related Modules:

  • bengal.rendering.validator: Template validation implementation
  • bengal.rendering.template_engine: Template engine for validation
  • bengal.cli.commands.validate: CLI validation command

See Also:

  • bengal/services/validation.py: TemplateValidationService for validation protocol
  • bengal/services/validation.py: DefaultTemplateValidationService for default implementation

Classes

TemplateValidationService
1
Inherits from Protocol

Methods 1

validate
1 int
def validate(self, site: Any) -> int
Parameters 1
site Any
Returns

int

DefaultTemplateValidationService dataclass
Adapter around bengal.rendering.validator with current TemplateEngine. Keeps CLI decoupled from co…
1

Adapter around bengal.rendering.validator with current TemplateEngine.

Keeps CLI decoupled from concrete rendering internals while preserving behavior.

Attributes

Name Type Description
strict bool

Methods 1

validate
1 int
def validate(self, site: Any) -> int
Parameters 1
site Any
Returns

int