[shellcheck] fix SC2155 warning (#8490)

Declare and assign separately to avoid masking return values.
This commit is contained in:
Jonathan Hui
2022-12-07 16:23:20 -08:00
parent 864236cbf1
commit 48c0582e4e
13 changed files with 125 additions and 52 deletions
+20 -10
View File
@@ -64,15 +64,25 @@
set -euo pipefail
readonly OT_BUILD_JOBS=$(getconf _NPROCESSORS_ONLN)
readonly OT_EXCLUDE_DIRS=(third_party doc/site)
OT_BUILD_JOBS=$(getconf _NPROCESSORS_ONLN)
readonly OT_BUILD_JOBS
readonly OT_CLANG_SOURCES=('*.c' '*.cc' '*.cpp' '*.h' '*.hpp')
readonly OT_MARKDOWN_SOURCES=('*.md')
readonly OT_PYTHON_SOURCES=('*.py')
OT_EXCLUDE_DIRS=(third_party doc/site)
readonly OT_EXCLUDE_DIRS
readonly OT_CLANG_TIDY_FIX_DIRS=('examples' 'include' 'src' 'tests')
readonly OT_CLANG_TIDY_BUILD_OPTS=(
OT_CLANG_SOURCES=('*.c' '*.cc' '*.cpp' '*.h' '*.hpp')
readonly OT_CLANG_SOURCES
OT_MARKDOWN_SOURCES=('*.md')
readonly OT_MARKDOWN_SOURCES
OT_PYTHON_SOURCES=('*.py')
readonly OT_PYTHON_SOURCES
OT_CLANG_TIDY_FIX_DIRS=('examples' 'include' 'src' 'tests')
readonly OT_CLANG_TIDY_FIX_DIRS
OT_CLANG_TIDY_BUILD_OPTS=(
'-DCMAKE_EXPORT_COMPILE_COMMANDS=ON'
'-DOT_ANYCAST_LOCATOR=ON'
'-DOT_APP_RCP=OFF'
@@ -129,8 +139,9 @@ readonly OT_CLANG_TIDY_BUILD_OPTS=(
'-DOT_COMPILE_WARNING_AS_ERROR=ON'
'-DOT_UPTIME=ON'
)
readonly OT_CLANG_TIDY_BUILD_OPTS
readonly OT_CLANG_TIDY_CHECKS="\
OT_CLANG_TIDY_CHECKS="\
-*,\
google-explicit-constructor,\
google-readability-casting,\
@@ -149,8 +160,7 @@ readability-redundant-member-init,\
readability-simplify-boolean-expr,\
readability-static-accessed-through-instance,\
"
#performance-for-range-copy\
readonly OT_CLANG_TIDY_CHECKS
do_clang_format()
{