Skip to content

Add diagnostic code pages to documentationΒ #343

@joshuadavidthomas

Description

@joshuadavidthomas

This came up in #339 but the diagnostic codes are not documented anywhere, you have to look in the source to see them:

fn diagnostic_code(&self) -> &'static str {
match self {
ValidationError::UnclosedTag { .. } => "S100",
ValidationError::UnbalancedStructure { .. } => "S101",
ValidationError::OrphanedTag { .. } => "S102",
ValidationError::UnmatchedBlockName { .. } => "S103",
ValidationError::MissingRequiredArguments { .. }
| ValidationError::MissingArgument { .. } => "S104",
ValidationError::TooManyArguments { .. } => "S105",
ValidationError::InvalidLiteralArgument { .. } => "S106",
ValidationError::InvalidArgumentChoice { .. } => "S107",
}

There should be either a page with all of them listed (like djlint has for it's codes), or maybe like ruff a dedicated page for each code. Dedicated pages would be a bit more work, but probably worth it in the long run? Linkability and being able to provide examples -- though I suppose you could achieve that with a single page too, so 🀷.

Metadata

Metadata

Assignees

No one assigned

    Labels

    πŸ“ docsImprovements or additions to documentation

    Projects

    Status

    πŸ“‹ Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions