-
Notifications
You must be signed in to change notification settings - Fork 708
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
style: address shellcheck warnings #1993
base: main
Are you sure you want to change the base?
Changes from 6 commits
fd5ca3f
a1e7a30
99d56aa
bd01342
739aa48
896ea2f
9a18e6f
31dc1e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ if [ -n "${ANDROID_NDK_ROOT-}" ]; then | |
android_tools=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin | ||
fi | ||
|
||
for arg in $*; do | ||
for arg in "$@"; do | ||
case $arg in | ||
--target=*) | ||
target=${arg#*=} | ||
|
@@ -215,7 +215,7 @@ if [ -n "${RING_COVERAGE-}" ]; then | |
# something similar but different. | ||
# export LLVM_PROFILE_FILE="$coverage_dir/%m.profraw" | ||
|
||
target_upper=$(echo ${target_lower} | tr '[:lower:]' '[:upper:]') | ||
target_upper=$(echo "${target_lower}" | tr '[:lower:]' '[:upper:]') | ||
|
||
case "$OSTYPE" in | ||
linux*) | ||
|
@@ -251,16 +251,16 @@ cargo "$@" | |
if [ -n "${RING_COVERAGE-}" ]; then | ||
# Keep in sync with check-symbol-prefixes.sh. | ||
# Use the host target-libdir, not the target target-libdir. | ||
llvm_root="$(rustc +${toolchain} --print target-libdir)/../bin" | ||
llvm_root="$(rustc +"${toolchain}" --print target-libdir)/../bin" | ||
|
||
while read executable; do | ||
while read -r executable; do | ||
basename=$(basename "$executable") | ||
${llvm_root}/llvm-profdata merge -sparse "$coverage_dir/$basename.profraw" -o "$coverage_dir/$basename.profdata" | ||
"${llvm_root}"/llvm-profdata merge -sparse "$coverage_dir/$basename.profraw" -o "$coverage_dir/$basename.profdata" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks weird to be inconsistent with having the double quotes only around the variable usage in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved by 31dc1e6. Though I was thinking about normalizing the usage of
@briansmith Are you ok with this? |
||
mkdir -p "$coverage_dir"/reports | ||
${llvm_root}/llvm-cov export \ | ||
--instr-profile "$coverage_dir"/$basename.profdata \ | ||
"${llvm_root}"/llvm-cov export \ | ||
--instr-profile "$coverage_dir/$basename.profdata" \ | ||
--format lcov \ | ||
"$executable" \ | ||
> "$coverage_dir"/reports/coverage-$basename.txt | ||
> "$coverage_dir/reports/coverage-$basename.txt" | ||
done < "$RING_BUILD_EXECUTABLE_LIST" | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ cargo clippy \ | |
--deny missing_docs \ | ||
--deny unused_qualifications \ | ||
--deny warnings \ | ||
$NULL | ||
"$NULL" |
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.
This looks weird. I wonder if there's a better way of doing it. Maybe removing the "outermost"-looking double quotes, similar to the
target_upper=...
line above?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.
Having outer quotes is fine because $() starts a new context (see SC2086) where the quoting is processed independently, so no escaping is required. However for consistency, I'll remove the outer quotes as it has not effect on the variable assignment.
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.
Resolved by 9a18e6f