Skip to content

Commit 3de5b43

Browse files
committed
add bash pre-commit hook and correct shellcheck warnings
1 parent c3845ff commit 3de5b43

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repos:
2+
- repo: git://github.com/detailyang/pre-commit-shell
3+
rev: 1.0.4
4+
hooks:
5+
- id: shell-lint

bin/steps/python

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@ VENDORED_PYTHON="${VENDOR_URL}/runtimes/$PYTHON_VERSION.tar.gz"
1010
SECURITY_UPDATE="Python has released a security update! Please consider upgrading to "
1111

1212
# check if runtime exists
13-
if curl --output /dev/null --silent --head --fail $VENDORED_PYTHON; then
14-
if [[ $PYTHON_VERSION == $PY37* ]]; then
13+
if curl --output /dev/null --silent --head --fail "$VENDORED_PYTHON"; then
14+
if [[ "$PYTHON_VERSION" == $PY37* ]]; then
1515
# do things to alert the user of security release available
16-
if [ $PYTHON_VERSION != $LATEST_37 ]; then
17-
puts-warn $SECURITY_UPDATE $LATEST_37
16+
if [ "$PYTHON_VERSION" != "$LATEST_37" ]; then
17+
puts-warn "$SECURITY_UPDATE" "$LATEST_37"
1818
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
1919
fi
2020
fi
21-
if [[ $PYTHON_VERSION == $PY36* ]]; then
21+
if [[ "$PYTHON_VERSION" == $PY36* ]]; then
2222
# security update note
23-
if [ $PYTHON_VERSION != $LATEST_36 ]; then
24-
puts-warn $SECURITY_UPDATE $LATEST_36
23+
if [ "$PYTHON_VERSION" != "$LATEST_36" ]; then
24+
puts-warn "$SECURITY_UPDATE" "$LATEST_36"
2525
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
2626
fi
2727
fi
28-
if [[ $PYTHON_VERSION == $PY35* ]]; then
28+
if [[ "$PYTHON_VERSION" == $PY35* ]]; then
2929
# security update note
30-
if [ $PYTHON_VERSION != $LATEST_35 ]; then
31-
puts-warn $SECURITY_UPDATE $LATEST_35
30+
if [ "$PYTHON_VERSION" != "$LATEST_35" ]; then
31+
puts-warn "$SECURITY_UPDATE" "$LATEST_35"
3232
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
3333
fi
3434
fi
35-
if [[ $PYTHON_VERSION == $PY27* ]]; then
35+
if [[ "$PYTHON_VERSION" == $PY27* ]]; then
3636
# security update note
37-
if [ $PYTHON_VERSION != $LATEST_27 ]; then
38-
puts-warn $SECURITY_UPDATE $LATEST_27
37+
if [ "$PYTHON_VERSION" != "$LATEST_27" ]; then
38+
puts-warn "$SECURITY_UPDATE" "$LATEST_27"
3939
echo " Learn More: https://devcenter.heroku.com/articles/python-runtimes"
4040
fi
4141
fi

0 commit comments

Comments
 (0)