Commit 36f5f0df authored by Michal Berger's avatar Michal Berger Committed by Jim Harris
Browse files

check_format: Fixes for shellcheck's SC2155 directive



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: default avatarMichal Berger <michalx.berger@intel.com>
Change-Id: I63e0b1a85ce16f7983e9ba6dd985046e8a39a650
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8500


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 79b6771f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
#!/usr/bin/env bash

readonly BASEDIR=$(readlink -f $(dirname $0))/..
source "$BASEDIR/scripts/common.sh"
rootdir=$(readlink -f "$(dirname "$0")")/..
source "$rootdir/scripts/common.sh"

cd $BASEDIR
cd "$rootdir"

# exit on errors
set -e