Skip to content

mirror.py does not update prek rev in README.md #171

Description

@Anselmoo

Bug

mirror.py updates the pre-commit YAML-style rev: entries in README.md but silently skips the prek TOML-style rev = entry. After many mirror runs the prek block falls behind:

[[repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.15.0"  # ← never updated, currently 18 releases behind

while all pre-commit blocks show the current version:

  rev: v0.15.18  # ← correctly updated

Root cause

replace_readme_md in mirror.py matches rev: v\d+\.\d+\.\d+ (colon, no quotes) but not rev = "v\d+\.\d+\.\d+" (equals + quotes).

Fix

Add one re.sub call inside replace_readme_md:

content = re.sub(r'rev = "v\d+\.\d+\.\d+"', f'rev = "v{version}"', content)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions