chore: try adding back pre-commit

This commit is contained in:
Daylin Morgan 2023-05-28 17:31:10 -05:00
parent 445a523b83
commit ea9a184e6a
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F
3 changed files with 13 additions and 2 deletions

View file

@ -11,4 +11,10 @@ repos:
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
- repo: local
hooks:
- id: set-version
language: script
name: sets __version__ in viv.py
entry: ./scripts/bump-dev.sh
files: viv.py$

5
scripts/bump-dev.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env sh
TAG=$(git describe --tags --always --dirty=-dev --exclude 'latest')
VERSION="${TAG#v}"
sed -i "s/__version__ = \".*\"/__version__ = \"$VERSION\"/g" src/viv/viv.py
git add src/viv/viv.py

View file

@ -52,7 +52,7 @@ from typing import (
from urllib.error import HTTPError
from urllib.request import urlopen
__version__ = "23.5a1-dev"
__version__ = "23.5a1-16-g445a523-dev"
class Config: