MD025 - Multiple top level headers in the same document
Fixed all errors
Update check_format.sh to fit new header style in jsonrpc.md
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ib5f832c549880771c99c15b89affe1e82acd3fa4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9045
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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
-g option using only files known to git, that allow us
to avoid errors from submodules
Also add check if mdl is installed, and gracefull info if not.
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ib6e1920774ffca81e62d9abebc8d8b4548feb519
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9086
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Use extended regexp to resolve any potential ambiguity with matching
on '('. This should fix the following failure as seen on the CI:
fatal: command line, '^SPDK_RPC_REGISTER\(': Unmatched ( or \(
Also, since errexit doesn't see failures inside the process
substitution make sure we return from the function with a proper $rc
in case git fails early on.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ia03095e9cc8cf11602dafb5bef28265abb485704
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8577
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
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>
Change-Id: Ifbde973eae6e261d79e1c340eb28644bce5f4e45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8503
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This is a first commit in the series addressing potential Bash issues
as discovered by the latest shellcheck release (0.7.2, shipped with
the very latest fedora33 and fedora34). The goal is to either fix,
locally or globally disable given directive(s).
SC2155: Declare and assign separately to avoid masking return values
Simplify the setting of the variable pointing at the root of the repo.
Also, keep it consistent with the rest of the scripts and declare it as
$rootdir.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I63e0b1a85ce16f7983e9ba6dd985046e8a39a650
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8500
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
On my system, the git grep for ^SPDK_RPC_REGISTER(
fails because the ( is unmatched. It seems we should
escape it, although clearly our CI systems don't seem
to require it.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6412e27e79488616743f76b2d9eac8f62b996078
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8393
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
All JSON-RPCs must be documented in jsonrpc.md
Change-Id: Iec9119a01433fd0cbe4df4477ce94cc2feeb0d54
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4074
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Community-CI: Mellanox Build Bot
-x is supported since 0.4.0 release, make a note of that.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Icc64132536c18108029f6c5fa2cbdd5b27018d8b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7417
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Currently, reference repos which are used to clone the SPDK repo in
the CI pool's systems don't provide master head refs, hence there's
no easy way to diff against it.
Instead, simply run shfmt against all the bash files in the repo.
Impact on the performance should be minimal.
Also, cleanup some related code which is not used anymore.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Ie0d4e35b8ad214ceed1b4ea29b01a7423b8ff73b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6824
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Checking only the .sh suffix was omitting ./configure and potentially
other bash scripts which don't necessarily have to include said suffix
in their name.
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I6196559e8875de46f80d9c8426577a1a79b5996d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6026
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Original code removed $symbol prefix from every entry in
$defined_symbols. This was incorrect shown by example
patch next in series.
Original function spdk_json_decode_object() was moved
and spdk_json_decode_object_relaxed() was added.
This resulted in $defined_symbols containing entry "_relaxed".
Now each entry in $defined_symbols is checked separatly to
match exactly to the removed $symbol.
Reported-by: Jacek Kalwas <jacek.kalwas@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1d9931d2e93dc85465ce47a838a176c6ab5f1587
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4357
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
shellcheck.log
shellcheck does not seem to reliably return error codes, at least
on the 0.7.0 version packaged on Fedora. Instead, look at
whether shellcheck.log contains any output.
Change-Id: Iec3c4f416844eed6a6c75b9204e24c2bc7243f7a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4072
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Even on version 0.7.0, the diff mode throws up a bunch of errors
that don't appear in the tty mode. We'll have to deal with those
at a later date.
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ic7001b9cf793e696bbf4bab0b0630e8d705a6905
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4071
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
I had previously implemented a portion of the naming convention
check that looked for symbols that had been moved by performing
two checks:
git diff commit1 commit2 -- libname | grep for added function
git diff commit2 commit1 --libname | grep for added functions
and then subtracting the values returned by the second check from
the values returned by the first check. That works as long as the two
diffs are reciprocal (i.e. the first diff is a mirror image of the
second). However, this has proven to not be the case.
This change fixes that check by performing the smae diff twice and
grepping for removed functions the same time.
Change-Id: I09c81921d68436baeee706f2d9a6d30db1d23976
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3229
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Make sure that git diff ignores all submodules while looking for
changes made by astyle. This should prevent the following issues
from occurring:
object directory /var/ci_repos/dpdk-submodule.git/objects does not exist; check .git/objects/info/alternates
object directory /var/ci_repos/intel-ipsec-mb.git/objects does not exist; check .git/objects/info/alternates
error: bad tree object HEAD
fatal: 'git status --porcelain=2' failed in submodule intel-ipsec-mb
Change-Id: Ie9a39e324674337fdbd6bf627da6e80775ceaeec
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3223
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
In a few tools or languages, slash(/) is maybe a delimiter by default in regex.
An unescaped delimiter must be escaped with a backslash (\).
Otherwise the pattern of regular expression will be error
when delimiter is slash(/) in a few special environment, i.e. in MinGW32 git bash.
Signed-off-by: Dayu Liu <liu.dayu@zte.com.cn>
Change-Id: I73b556416b98e135eb240078dcc68f80e08c5e74
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2488
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
There was an edge case in this check where a public symbol
definition was just moved and that movement triggered this
check. Going forward, check the diff for symbols that were
both added and removed in the same patch. This indicates a
symbol that was just moved instead of newly added.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I71bbcd6d6b3e0a2133e77c29f4ec7a4f2b09e3c2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2765
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
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>
Community-CI: Mellanox Build Bot
It turns out we have a function to compare version numbers.
It additionally handles cases like "3.0.10 > 3.0.9". The
previous code returned false, the new one returns true.
version_lt() actually tests for less or equal, so compare
against 3.1.0 - the real minimum shfmt version we need.
Change-Id: Ibd18c4505e5b81c0073a907f23c3fc034cfbafbe
Suggested-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2574
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Previously when doing the naming conventions check, we were
checking against master which was causing some weird issues on
patches which weren't rebased. The much simpler check is to just
compare each patch against the previous one.
This method still works to prevent any bad changes from getting
merged, but handles naming issues on a patch by patch basis.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ic031ce07ca1c67819b792dc292dcf6c50df5b1a2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2733
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
If $output_dir is set, putting the shfmt diff there will make it
easier to extract it and/or look it up from the side of the per
patch build.
Change-Id: Iefb601a29f165e59b7670a8878e95bb6b16c9650
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2277
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This test prevents anyone from adding a function that begins with
spdk to the lib or module directories without also adding that file
to the corresponding map file and a header in spdk/include or
spdk_internal/include.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ife7db13d4bb8fec7570c8492ac3326222a850c36
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2423
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
All of the other checks simply print OK if the test passes
this check prints out a lot of text (especially when run at the
tip of long patch series) that can make it difficult to tell if
anything is actually wrong.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ie681d200aa13f208e4afa1ab419cbad63ef6606c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2403
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
A newer version of shfmt was released, but the script still
looked explicitly for the older one.
Make it execute the first binary '^shfmt.*' in PATH whose --version
returns at least v3.1.0.
Change-Id: If621abfa4d995a9dc985e6bab8c33aa36c327fae
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2428
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Add new dev tool for enforcing proper formatting of the Bash code
across the entire repo. This is done in order of defining a common
set of good practices to follow when writing .sh|Bash code.
As powerful as shfmt may be, it allows only for some specific rules
to be enforced, hence it still needs to work side by side with
shellcheck syntax-wise. If it comes to style, following rules are
being enforced:
* indent_style = tab - Lines must be indented with tabs. The exception
from this rule is the use of heredocs with
<<BASH redirect operator. Spaces can be used to
format the line only if it's already preceded
with a tab.
* binary_next_line = true - Lines can start with logical operators. E.g:
if [[ -v foo ]] \
&& [[ -v bar ]]; then
...
fi
* switch_case_indent = true - case|esac patterns are indented with tabs.
* space_redirects = true - redirect operators are followed with a space.
E.g: > foo over >foo.
In addition, shfmt will enforce its own Bash-style for different parts
of the code as well. Examples and more details can be found here:
https://github.com/mvdan/sh
Change-Id: I6e5c8d79e6dba9c6471010f3d0f563dd34e62fd6
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1418
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
SC2010: Don't use ls | grep. Use a glob or a for loop
with a condition to allow non-alphanumeric filenames.
Replacing e.g. "ls /dev/nbd* | grep -v p" would be complex
and problematic as flag -I for ls is not working when
looking for pattern.
Change-Id: I9e88359d247fe5dcf952a3388b0e7f35164768c1
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/481602
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Add to pernamently excluded in shellcheck:
SC2034: foo appears unused. Verify it or export it.
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ib63edb8cdf8ec718981d28d5acec75772b825a48
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478102
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Correct shellcheck rule SC2045: Iterating over ls output is fragile. Use globs.
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I436878774d6f86c23b1c5cf5220da297053f03e2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477397
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
SC1083: This {/} is literal. Check expression (missing ;/\n?) or quote it.
This rule points to places that are part of command
and cannot be fixed:
1. git archive HEAD^{tree}
2. vpp (e.g. dpdk { no-pci })
Change-Id: I30117913f964415cdaed94d29b1209d119e4d5a4
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/479986
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
SC2097: This assignment is only seen by the forked process.
SC2098: This expansion will not see the mentioned assignment.
Apply these two rules together as they point to the same code.
Change-Id: I61020e8fd4b6db2b06ae8134d1004290a9bef9e7
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476777
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This shellcheck case warns users when they use the pattern A && B || C
so that they don't accidentally try to use it as an if-then-else
statement. However, there is a valid way of using this pattern to
denote, do A, if it succeeds, do B, if either A or B fails, do C.
Change-Id: I283b433c15d07873befd182e8327f2e0602490aa
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476960
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
SC2119: Use foo "$@" if function's $1 should mean script's $1.
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I8366debbf83dfc8f3c1033e1e9fe3df17e45ab49
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476468
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Remove from shellcheck excluded SC2090: Quotes/backslashes
in this variable will not be respected.
After fix SC2089 this warning is not actually present in
any of spdk/spdk scripts.
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ibe0015b569202eb7d3f3197f5c5630a67e701332
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476467
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Correct shellcheck rule SC2089: Quotes/backslashes will be treated literally. Use an array.
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I40d4eef334cd030294669f8e8494f9e7a563d495
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476466
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
SC2016: Expressions don't expand in single quotes, use double quotes for that.
We need to exclude this shellcheck because in some cases, for example in
test/vhost/common.sh we echo line to new script file.
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I98d322d917cbda034787cb29a267b86a8ad7e7ec
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475713
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Correct shellcheck rule SC2012: Use find instead of ls to better handle non-alphanumeric filenames
Change-Id: Ibfc54ac06ae4cecadd22954159d259295f99912f
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475712
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Correct shellcheck rule SC2128: Expanding an array without an index only gives the first element.
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I0e7c335af678114dc78dfb12a02369a69158e435
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474989
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Remove from shellcheck excluded SC2142: Aliases can't use
positional parameters. Use a function.
This warning is not actually present in any of spdk/spdk scripts.
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I0af375c062724dc8fcee5a6cd4b8ac99bda260ac
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473292
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Correct shellcheck rule SC2140: Word is on the form "A"B"C"
(B indicated). Did you mean "ABC" or "A\"B\"C"?
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I1655b2e76be7a5e3d615c5b34c5af9e4012ac49f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473291
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Corrected code in some files.
Most of cases cannot be corrected as we use global variables
defined in other files.
SC2154: var is referenced but not assigned.
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Change-Id: Id333587f81b0bc2456b0c97bac5343a8e5a22774
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472342
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>