jdx/mise · error

idiomatic version files markers are reversed

Error message

idiomatic version files markers are reversed

What it means

Docs-consistency guard in render_idiomatic_version_files: the idiomatic version files section markers in docs/configuration.md are out of order — the END marker appears before (or is misplaced relative to) the START marker, so the generated region cannot be extracted correctly. Fires during `mise run render` when the doc template was edited incorrectly.

Source

Thrown at src/cli/render_help.rs:41

            cmd!("prettier.cmd", "--write", "docs/.vitepress/cli_commands.ts").run()?;
        } else {
            cmd!("prettier", "--write", "docs/.vitepress/cli_commands.ts").run()?;
        }
        Ok(())
    }
}

fn render_idiomatic_version_files() -> Result<()> {
    let path = "docs/configuration.md";
    let content = file::read_to_string(path)?;
    let start = content
        .find(IDIOMATIC_FILES_START)
        .wrap_err("missing idiomatic version files start marker")?
        + IDIOMATIC_FILES_START.len();
    let end = content
        .find(IDIOMATIC_FILES_END)
        .wrap_err("missing idiomatic version files end marker")?;
    ensure!(start <= end, "idiomatic version files markers are reversed");

    let table = render_idiomatic_version_files_table();
    let rendered = format!(
        "{}\n\n{}\n\n{}",
        &content[..start],
        table.trim(),
        &content[end..]
    );
    file::write(path, rendered)?;
    Ok(())
}

fn render_idiomatic_version_files_table() -> String {
    let rows = registry::baked_registry()
        .iter()
        .filter(|(plugin, tool)| *plugin == tool.short && !tool.idiomatic_files.is_empty())
        .map(|(plugin, tool)| {
            let files = tool

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Check docs/configuration.md and place IDIOMATIC_FILES_START before IDIOMATIC_FILES_END
  2. Restore the markers if an edit removed or duplicated one
  3. Re-run `mise run render` after fixing the doc
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/cli/render_help.rs:41 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/87ff900fea7b5952. Report an issue: GitHub.