numam-spdk/scripts
Michal Berger 1cf67849c8 check_format: Ignore shellcheck's SC2128 and SC2178 directives
These are currently prone to false-positives especially in terms of
scoping. Consider the following:

foo() {
	local bar=(42)
	echo "${bar[*]}"
}

bar=43
foo
echo "$bar"

Some versions of shellcheck, including the latest, 0.7.2, complain
about $bar being reused as a plain string here. This is incorrect
since foo() holds its own copy of bar[@] hence the assignment which
takes place outside of it doesn't affect its content.

SC2178 can be mitigated be reversing the order of declaration:

bar=43
foo() { ... }
...

but the SC2128 still remains.

Currently, in our code majority of these warnings are coming from
false-positives due to initial source'ing which most of our test
scripts do (e.g. they fetch a function where local bar=() is used
and in the test itself $bar happens to be assigned a plain string.
This is still valid code).

To mitigate, disable these directives untill shellcheck is capable
of properly interpreting scoping when checking them.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8503 (master)

(cherry-picked from commit 9d48662103)
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Ifbde973eae6e261d79e1c340eb28644bce5f4e45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9801
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-10-27 08:47:51 +00:00
..
bash-completion event: replace master_core with main_core in spdk_app_opts 2020-12-03 09:41:07 +00:00
ceph scripts/ceph: load loop module explicitly 2021-05-10 10:45:57 +00:00
perf scripts/nvmf_perf: fix pylint E741 2021-05-21 08:01:49 +00:00
pkgdep pgkdep/freebsd: Use py37-pycodestyle 2021-01-13 10:07:31 +00:00
rpc scripts/rpc: Make sure address argument is properly interpreted 2021-07-26 08:41:37 +00:00
spdkcli nvmf: remove usage of "whitelist" 2020-12-03 09:41:07 +00:00
vagrant nvmf/vfio_user: disable vfio_user by default 2021-01-29 17:06:10 +00:00
check_format.sh check_format: Ignore shellcheck's SC2128 and SC2178 directives 2021-10-27 08:47:51 +00:00
common.sh scripts: replace PCI_WHITELIST with PCI_ALLOWED 2020-12-03 09:41:07 +00:00
config_converter.py scripts/config_converter: skip sections not present in legacy config 2021-01-15 08:32:10 +00:00
core-collector.sh scripts: Use core dump collector 2021-01-06 00:01:05 +00:00
detect_cc.sh check_format: Reformat the Bash code in compliance with shfmt 2020-05-07 20:52:21 +00:00
dpdk_mem_info.py scripts: add a parser for the dpdk memory stats. 2020-01-24 05:46:43 +00:00
eofnl scripts/check_format: check trailing whitespace 2017-10-24 17:35:23 -04:00
fio.py scripts/fio.py: add argparse for command line parameters 2019-06-03 04:34:10 +00:00
gdb_macros.py scripts: Use range instead of xrange 2019-02-13 22:54:15 +00:00
gen_ftl.sh check_format: Reformat the Bash code in compliance with shfmt 2020-05-07 20:52:21 +00:00
gen_nvme.sh script/gen_nvme: do not generate legacy configuration 2020-10-22 17:08:41 +00:00
genconfig.py genconfig.py: allow numbers in config option names 2020-02-20 14:40:19 +00:00
histogram.py histograms: add script for parsing histogram data 2019-01-24 14:14:32 +00:00
iostat.py script: add iostat.py to check bdev iostat 2020-01-22 13:51:41 +00:00
pc_libs.sh build: generate pkg-config files for SPDK 2021-01-21 09:46:32 +00:00
pc_modules.sh build: generate pkg-config files for SPDK 2021-01-21 09:46:32 +00:00
pc.sh build: generate pkg-config files for SPDK 2021-01-21 09:46:32 +00:00
pkgdep.sh scripts/pkgdep: Move distro independent parts to a common place 2020-08-10 11:28:20 +00:00
posix.txt build: Automatically detect use of POSIX includes 2017-05-08 13:20:37 -07:00
prep_benchmarks.sh check_format: Reformat the Bash code in compliance with shfmt 2020-05-07 20:52:21 +00:00
qat_setup.sh configure: remove --with-igb-uio-driver option 2021-01-22 08:47:48 +00:00
rpc_http_proxy.py scripts: Add SSL certificate option in rpc_http_proxy 2020-05-05 08:04:00 +00:00
rpc.py spdk_top: add rpc for scheduler and governor 2021-01-22 18:33:13 +00:00
rxe_cfg_small.sh test/nvmf: Use rxe_cfg to get rxe-enabled net devices 2021-05-10 10:45:57 +00:00
setup.sh check_format: Fixes for shellcheck's SC2030 directive 2021-10-27 08:47:51 +00:00
spdkcli.py scripts/spdkcli: Stay on command input. 2020-07-08 07:55:15 +00:00
sync_dev_uevents.sh scripts: Add tool for keeping uevents in sync 2020-09-07 09:27:42 +00:00