New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix shellcheck warnings #4042
Fix shellcheck warnings #4042
Conversation
scripts/test_downgrade_from_tag.sh
Outdated
@@ -158,7 +158,8 @@ wait_for_pg() { | |||
exit 1 | |||
} | |||
|
|||
VERSION=`echo ${UPDATE_FROM_TAG} | sed 's/\([0-9]\{0,\}\.[0-9]\{0,\}\.[0-9]\{0,\}\).*/\1/g'` | |||
# shellcheck disable=SC2001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# shellcheck disable=SC2001 | |
# shellcheck disable=SC2001 -- See if you can use ${variable//search/replace} instead. |
I find it convenient to add the description of what is disabled. Not sure it works in this syntax though, maybe a new line is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Judging from their docs, should work with a second # instead of dashes
# shellcheck disable=SC2001 | |
# shellcheck disable=SC2001 # See if you can use ${variable//search/replace} instead. |
scripts/test_downgrade_from_tag.sh
Outdated
# shellcheck disable=SC2034 | ||
for i in {1..20}; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# shellcheck disable=SC2034 | |
for i in {1..20}; do | |
for _ in {1..20}; do |
We can use underscore for dummy variables, shellcheck won't complain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how these warnings managed to escape the initial check...
4129165
to
1eaf2c9
Compare
Codecov Report
@@ Coverage Diff @@
## master #4042 +/- ##
==========================================
- Coverage 90.70% 90.66% -0.04%
==========================================
Files 214 214
Lines 38726 38733 +7
==========================================
- Hits 35126 35118 -8
- Misses 3600 3615 +15
Continue to review full report at Codecov.
|
scripts/test_downgrade_from_tag.sh
Outdated
@@ -194,7 +194,7 @@ docker_pgcmd ${CONTAINER_ORIG} "CHECKPOINT;" | |||
srcdir=$(docker exec ${CONTAINER_ORIG} /bin/bash -c 'pg_config --pkglibdir') | |||
FILES=$(docker exec ${CONTAINER_ORIG} /bin/bash -c "ls $srcdir/timescaledb*.so") | |||
for file in $FILES; do | |||
docker cp ${CONTAINER_ORIG}:$file ${TEST_TMPDIR}/`basename $file` | |||
docker cp ${CONTAINER_ORIG}:$file "${TEST_TMPDIR}/$(basename $file)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need quotes around the first parameter too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add those as well.
scripts/test_downgrade_from_tag.sh
Outdated
@@ -205,8 +205,8 @@ docker_run_vol ${CONTAINER_UPDATED} ${UPDATE_VOLUME}:/var/lib/postgresql/data ${ | |||
|
|||
dstdir=$(docker exec ${CONTAINER_UPDATED} /bin/bash -c 'pg_config --pkglibdir') | |||
for file in $FILES; do | |||
docker cp ${TEST_TMPDIR}/`basename $file` ${CONTAINER_UPDATED}:$dstdir | |||
rm ${TEST_TMPDIR}/`basename $file` | |||
docker cp "${TEST_TMPDIR}/$(basename $file)" ${CONTAINER_UPDATED}:$dstdir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need quotes around the last parameter too?
1eaf2c9
to
ac67368
Compare
No description provided.