Skip to content

CI style job fails on every PR: uv.lock conflicts with pretty-format-toml hook #47

Description

@FANNG1

Problem

Since deeb798 ("chore: prepare 0.4.0 release"), the style CI job fails on every PR with:

Pretty format TOML.......................................................Failed
File uv.lock is not pretty-formatted

Root cause

The pretty-format-toml pre-commit hook runs with --all-files and checks uv.lock. But uv rewrites the whole lock file in its own canonical style (4-space indent, { url = ... }, trailing commas) every time it regenerates it, which is incompatible with the hook's style (2-space indent, {url = ...}, no trailing commas).

deeb798 bumped the project version, which regenerated uv.lock in uv's native format (the only semantic change was version = "0.3.3" -> "0.4.0"; the other ~800 changed lines are pure reformatting). Since pre-commit wasn't run before committing, main's uv.lock no longer satisfies the hook, and every PR based on main fails the style job through no fault of its own (e.g. #44 had to include an unrelated 827-line uv.lock reformat commit to go green).

The two formats are mutually exclusive: any future uv lock run (dependency upgrade, release version bump) will wipe out the hook's formatting again, so this will keep recurring as long as the hook covers uv.lock.

Proposed fix

Exclude uv.lock from the pretty-format-toml hook. Lock files are machine-generated and machine-consumed; uv already produces deterministic output, and reformatting them only creates noise and this exact CI deadlock. This matches common practice of excluding lock files (uv.lock, Cargo.lock, poetry.lock) from formatters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions