diff --git a/README.md b/README.md index b6abf5b..ed54090 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # ruff-pre-commit +[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) +[![image](https://img.shields.io/pypi/v/0.0.272/ruff.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/l/0.0.272/ruff.svg)](https://pypi.python.org/pypi/ruff) +[![image](https://img.shields.io/pypi/pyversions/0.0.272/ruff.svg)](https://pypi.python.org/pypi/ruff) +[![Actions status](https://github.com/astral-sh/ruff-pre-commit/workflows/CI/badge.svg)](https://github.com/astral-sh/ruff-pre-commit/actions) + A [pre-commit](https://pre-commit.com/) hook for [Ruff](https://github.com/charliermarsh/ruff). Distributed as a standalone repository to enable installing Ruff via prebuilt wheels from @@ -36,3 +42,9 @@ reformatting. ## License MIT + +
+ + + +
diff --git a/update_version.py b/update_version.py index 2c83647..9a78dde 100644 --- a/update_version.py +++ b/update_version.py @@ -9,9 +9,11 @@ def main(): readme_md = Path("README.md") readme = readme_md.read_text() rev = Path(".version").read_text().strip() - readme = re.sub("rev: .*", f"rev: v{rev}", readme) + readme = re.sub(r"rev: v\d+\.\d+\.\d+", f"rev: v{rev}", readme) + readme = re.sub(r"/\d+\.\d+\.\d+/ruff\.svg", f"/{rev}/ruff.svg", readme) readme_md.write_text(readme) - # Only commit on change + + # Only commit on change. # https://stackoverflow.com/a/9393642/3549270 if check_output(["git", "status", "-s"]).strip(): check_call(["git", "add", readme_md])