Skip to content

Commit

Permalink
Merge branch 'develop' into improvement/add_mypy_to_dev_requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonnnj committed Feb 17, 2021
2 parents 12033ed + 3619cfd commit 5b34e86
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 43 deletions.
15 changes: 12 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,20 @@ repos:
hooks:
- id: prettier
- repo: https://github.com/adrienverge/yamllint
rev: v1.25.0
rev: v1.26.0
hooks:
- id: yamllint
args:
- --strict

# Shell script hooks
- repo: https://github.com/lovesegfault/beautysh
rev: 6.0.1
hooks:
- id: beautysh
args:
- --indent-size
- '2'
- repo: https://github.com/detailyang/pre-commit-shell
rev: 1.0.5
hooks:
Expand Down Expand Up @@ -85,16 +92,18 @@ repos:
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.790
rev: v0.800
hooks:
- id: mypy
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
rev: v2.10.0
hooks:
- id: pyupgrade

# Ansible hooks
- repo: https://github.com/ansible-community/ansible-lint
# This is intentionally being held back because of issues in v5 per
# https://github.com/cisagov/skeleton-ansible-role/issues/69
rev: v4.3.7
hooks:
- id: ansible-lint
Expand Down
66 changes: 33 additions & 33 deletions bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,38 @@ old_version=$(sed -n "s/^__version__ = \"\(.*\)\"$/\1/p" $VERSION_FILE)

if [ $# -ne 1 ]
then
echo "$HELP_INFORMATION"
echo "$HELP_INFORMATION"
else
case $1 in
major|minor|patch|prerelease|build)
new_version=$(python -c "import semver; print(semver.bump_$1('$old_version'))")
echo Changing version from "$old_version" to "$new_version"
# A temp file is used to provide compatability with macOS development
# as a result of macOS using the BSD version of sed
tmp_file=/tmp/version.$$
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
mv $tmp_file $VERSION_FILE
git add $VERSION_FILE
git commit -m"Bump version from $old_version to $new_version"
git push
;;
finalize)
new_version=$(python -c "import semver; print(semver.finalize_version('$old_version'))")
echo Changing version from "$old_version" to "$new_version"
# A temp file is used to provide compatability with macOS development
# as a result of macOS using the BSD version of sed
tmp_file=/tmp/version.$$
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
mv $tmp_file $VERSION_FILE
git add $VERSION_FILE
git commit -m"Bump version from $old_version to $new_version"
git push
;;
show)
echo "$old_version"
;;
*)
echo "$HELP_INFORMATION"
;;
esac
case $1 in
major|minor|patch|prerelease|build)
new_version=$(python -c "import semver; print(semver.bump_$1('$old_version'))")
echo Changing version from "$old_version" to "$new_version"
# A temp file is used to provide compatability with macOS development
# as a result of macOS using the BSD version of sed
tmp_file=/tmp/version.$$
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
mv $tmp_file $VERSION_FILE
git add $VERSION_FILE
git commit -m"Bump version from $old_version to $new_version"
git push
;;
finalize)
new_version=$(python -c "import semver; print(semver.finalize_version('$old_version'))")
echo Changing version from "$old_version" to "$new_version"
# A temp file is used to provide compatability with macOS development
# as a result of macOS using the BSD version of sed
tmp_file=/tmp/version.$$
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
mv $tmp_file $VERSION_FILE
git add $VERSION_FILE
git commit -m"Bump version from $old_version to $new_version"
git push
;;
show)
echo "$old_version"
;;
*)
echo "$HELP_INFORMATION"
;;
esac
fi
14 changes: 7 additions & 7 deletions setup-env
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ while (( "$#" )); do
shift
;;
-*) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
PARAMS="$PARAMS $1"
shift
;;
esac
done

# set positional arguments in their proper place
Expand Down

0 comments on commit 5b34e86

Please sign in to comment.