nikitastupin / clairvoyance

Obtain GraphQL API schema even if the introspection is disabled
Apache License 2.0
960 stars 87 forks source link

Refactoring: exceptions #84

Closed Privat33r-dev closed 2 months ago

Privat33r-dev commented 3 months ago

Made a minor refactoring

Privat33r-dev commented 3 months ago

Should I bump to 2.5.4? Since the latest tag is 2.5.3, but version is toml is mismatching. Normally I suggest to automate workflow to avoid these kind of situations.

Wrote a short script that could be used in .git/hooks/pre-push with the assumption that the single source of truth for version would be ./pyproject.toml file:

root_dir=$(git rev-parse --show-toplevel)
current_branch=$(git symbolic-ref --short HEAD)
current_tag=$(git describe --abbrev=0 --tags $current_branch 2>/dev/null)
version=v$(grep -oP -m 1 'version = "\K[^"]+' $root_dir/pyproject.toml)

if [[ "$current_tag" != "$version" ]]; then
  echo "Tag version ($current_tag) differs from version in pyproject.toml ($version)"
  git tag "$version" -m "Version $version" $current_branch && echo "Tag updated to $version" || echo "Couldn't update tag version"
fi