Skip to content

prek update quotes revisions that YAML already parses as strings #2852

Closed

Description

@redeboer

Before submitting

  • I have searched the issue list for similar bug reports.

Summary

Since #1936, prek update adds quotes to an updated rev that was unquoted before, whenever the new revision starts with a digit. That also happens for versions with more than one dot, such as 0.12.24, which YAML already reads as a string:

   - repo: https://github.com/astral-sh/uv-pre-commit
-    rev: 0.12.23
+    rev: "0.12.24"

Since #1379 aims to preserve the existing quoting style, I would expect update to leave such a revision unquoted, and to add quotes only when the new value would otherwise not be parsed as a string, for instance 2026.4, 1e3, 0x1F, a frozen SHA that consists of digits only (#1343), or values like true and null.

Platform

Linux x86_64 (RHEL 9)

Version (current: 0.5.5)

prek 0.5.5

.pre-commit-config.yaml

repos:
  - repo: https://github.com/astral-sh/uv-pre-commit
    rev: 0.12.23
    hooks:
      - id: uv-lock
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: check-yaml

Log file


Activity

  1. added
    bugSomething isn't working
    on Oct 9, 2026
  2. added a commit that references this issue on Oct 9, 2026
    d8b4548
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions