jpeach commented on code in PR #9757:
URL: https://github.com/apache/trafficserver/pull/9757#discussion_r1212436189
##########
tools/git/pre-commit:
##########
@@ -44,19 +49,19 @@ if [ ! -x "$FORMAT" ]; then
fi
source "$GIT_TOP/tools/autopep8.sh"
-if [ ! -d ${AUTOPEP8_VENV} ]; then
+if [ ! -d "${AUTOPEP8_VENV}" ]; then
echo "Run \"make autopep8\""
exit 1
fi
-source ${AUTOPEP8_VENV}/bin/activate
+source "${AUTOPEP8_VENV}/bin/activate"
# Where to store the patch
clang_patch_file=$(mktemp -t clang-format.XXXXXXXXXX)
autopep8_patch_file=$(mktemp -t autopep8.XXXXXXXXXX)
-trap "rm -f $clang_patch_file $autopep8_patch_file" 0 1 2 3 5 15
+trap 'rm -f $clang_patch_file $autopep8_patch_file' 0 1 2 3 15
Review Comment:
The shellcheck issue is:
```
In tools/git/pre-commit line 61:
trap "rm -f $clang_patch_file $autopep8_patch_file" 0 1 2 3 15
^---------------^ SC2064 (warning): Use single quotes, otherwise
this expands now rather than when signalled.
^------------------^ SC2064 (warning): Use
single quotes, otherwise this expands now rather than when signalled.
For more information:
https://www.shellcheck.net/wiki/SC2064 -- Use single quotes, otherwise
this...
```
In this case, I think that expanding these variable when the trap is called
is OK,since their values arenever changed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]