Add badges to README (#40)
This commit is contained in:
parent
ec8193bd58
commit
8698dbc7cd
12
README.md
12
README.md
@ -1,5 +1,11 @@
|
||||
# ruff-pre-commit
|
||||
|
||||
[](https://github.com/astral-sh/ruff)
|
||||
[](https://pypi.python.org/pypi/ruff)
|
||||
[](https://pypi.python.org/pypi/ruff)
|
||||
[](https://pypi.python.org/pypi/ruff)
|
||||
[](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
|
||||
|
||||
<div align="center">
|
||||
<a target="_blank" href="https://astral.sh" style="background:none">
|
||||
<img src="https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/svg/Astral.svg">
|
||||
</a>
|
||||
</div>
|
||||
|
@ -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])
|
||||
|
Loading…
Reference in New Issue
Block a user