jdx/mise · error

Following config files are not properly formatted

Error message

Following config files are not properly formatted:
{}

What it means

`mise fmt` collected parse/format errors for one or more config files and bails listing them. Files that could be parsed were rewritten; files whose TOML failed to parse or format are reported so the user can fix them manually.

Solutions

  1. Fix the syntax error in each listed file (the message lists them line-by-line)
  2. Validate TOML with a linter/editor plugin before saving
  3. Restore the file from version control if the edit broke it

Example fix

// before
[env]
FOO = "unclosed
// after
[env]
FOO = "closed"
Defensive patterns

Strategy: validation

Validate before calling

python3 -c "import tomllib;tomllib.load(open('mise.toml','rb'))" && echo ok

Prevention

When it happens

Trigger: While iterating configs, parsing or formatting a TOML file produced an error pushed into `errors`; after processing all files errors is non-empty.

Common situations: Hand-edited mise.toml with syntax errors (unclosed strings, bad tables), TOML features the formatter cannot round-trip, or an unreadable/locked file.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/7f1f6d1ec7e34e7c. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/fmt.rs:88

                .is_some_and(|f| f.to_string_lossy().ends_with("toml"))
            {
                continue;
            }
            let source = file::read_to_string(&p)?;
            let toml = source.clone();
            let toml = sort(toml)?;
            let toml = format(toml)?;
            if self.check {
                if source != toml {
                    errors.push(p.display().to_string());
                }
                continue;
            }
            file::write(&p, &toml)?;
        }

        if !errors.is_empty() {
            bail!(
                "Following config files are not properly formatted:\n{}",
                errors.join("\n")
            );
        }

        Ok(())
    }
}

/// Put the document's top-level keys and its unordered lists into a canonical
/// order. Whitespace and layout are left to [`format`].
fn sort(toml: String) -> Result<String> {
    let mut doc: DocumentMut = toml.parse()?;
    let order = |k: String| match k.as_str() {
        "min_version" => 0,
        "env_file" => 1,
        "env_path" => 2,
        "_" => 3,

View on GitHub (pinned to 533346cc37)