Skip to main content

validate_format

Function validate_format 

Source
pub fn validate_format(
    entry: &IndexEntry,
    value: &str,
    catalogue: &Catalogue,
) -> FormatCheck
Expand description

Validate value against the format rule attached to entry.

Resolution order:

  1. entry.format_regex (inline) wins.
  2. entry.pattern_id then resolves through catalogue.
  3. Neither set → FormatCheck::NoRule.

Inline regex compile errors surface as FormatCheck::Error — the caller decides whether that’s a hard fail or a doctor-style warning.