Skip to content

Commit d792c5e

Browse files
rockett-mHalosGhost
authored andcommitted
style: made shell scripts all have 4 spaces for indentation; fixes #272
Signed-off-by: Morgan Rockett <[email protected]>
1 parent 9624329 commit d792c5e

File tree

4 files changed

+65
-64
lines changed

4 files changed

+65
-64
lines changed

scripts/install-build-tools.sh

+24-23
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,35 @@ if (( $EUID != 0 )); then
1515
fi
1616

1717
if [[ "$OSTYPE" == "darwin"* ]]; then
18-
CPUS=$(sysctl -n hw.ncpu)
19-
# ensure development environment is set correctly for clang
20-
$SUDO xcode-select -switch /Library/Developer/CommandLineTools
21-
brew install llvm@14 googletest google-benchmark lcov make wget cmake curl
22-
CLANG_TIDY=/usr/local/bin/clang-tidy
23-
if [ ! -L "$CLANG_TIDY" ]; then
24-
$SUDO ln -s $(brew --prefix)/opt/llvm@14/bin/clang-tidy /usr/local/bin/clang-tidy
25-
fi
26-
GMAKE=/usr/local/bin/gmake
27-
if [ ! -L "$GMAKE" ]; then
28-
$SUDO ln -s $(xcode-select -p)/usr/bin/gnumake /usr/local/bin/gmake
29-
fi
18+
CPUS=$(sysctl -n hw.ncpu)
19+
# ensure development environment is set correctly for clang
20+
$SUDO xcode-select -switch /Library/Developer/CommandLineTools
21+
brew install llvm@14 googletest google-benchmark lcov make wget cmake curl
22+
CLANG_TIDY=/usr/local/bin/clang-tidy
23+
if [ ! -L "$CLANG_TIDY" ]; then
24+
$SUDO ln -s $(brew --prefix)/opt/llvm@14/bin/clang-tidy /usr/local/bin/clang-tidy
25+
fi
26+
27+
GMAKE=/usr/local/bin/gmake
28+
if [ ! -L "$GMAKE" ]; then
29+
$SUDO ln -s $(xcode-select -p)/usr/bin/gnumake /usr/local/bin/gmake
30+
fi
3031
fi
3132

3233
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
33-
$SUDO apt update
34-
$SUDO apt install -y build-essential wget cmake libgtest-dev libbenchmark-dev lcov git software-properties-common rsync unzip
35-
36-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | $SUDO apt-key add -
37-
$SUDO add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"
38-
$SUDO apt install -y clang-format-14 clang-tidy-14
39-
$SUDO ln -s -f $(which clang-format-14) /usr/local/bin/clang-format
40-
$SUDO ln -s -f $(which clang-tidy-14) /usr/local/bin/clang-tidy
34+
$SUDO apt update
35+
$SUDO apt install -y build-essential wget cmake libgtest-dev libbenchmark-dev lcov git software-properties-common rsync unzip
36+
37+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | $SUDO apt-key add -
38+
$SUDO add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"
39+
$SUDO apt install -y clang-format-14 clang-tidy-14
40+
$SUDO ln -s -f $(which clang-format-14) /usr/local/bin/clang-format
41+
$SUDO ln -s -f $(which clang-tidy-14) /usr/local/bin/clang-tidy
4142
fi
4243

4344
PYTHON_TIDY=/usr/local/bin/run-clang-tidy.py
4445
if [ ! -f "${PYTHON_TIDY}" ]; then
45-
echo -e "${green}Copying run-clang-tidy to /usr/local/bin${end}"
46-
wget https://raw.githubusercontent.com/llvm/llvm-project/e837ce2a32369b2e9e8e5d60270c072c7dd63827/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
47-
$SUDO mv run-clang-tidy.py /usr/local/bin
46+
echo -e "${green}Copying run-clang-tidy to /usr/local/bin${end}"
47+
wget https://raw.githubusercontent.com/llvm/llvm-project/e837ce2a32369b2e9e8e5d60270c072c7dd63827/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
48+
$SUDO mv run-clang-tidy.py /usr/local/bin
4849
fi

scripts/lint.sh

+10-10
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@ if [ -n "$newline_files" ] ; then
2121
fi
2222

2323
if [ -n "$whitespace_files" ] || [ -n "$newline_files" ] ; then
24-
exit 1
24+
exit 1
2525
fi
2626

2727
check_format_files=$(git ls-files | grep -E "tools|tests|src|cmake-tests" \
2828
| grep -E "\..*pp")
2929
clang-format --style=file --Werror --dry-run ${check_format_files[@]}
3030

3131
if ! command -v clang-tidy &>/dev/null; then
32-
echo "clang-tidy does not appear to be installed"
33-
echo "Please run ./scripts/setup-dependencies.sh to install dependencies or install manually."
34-
exit 1
32+
echo "clang-tidy does not appear to be installed"
33+
echo "Please run ./scripts/setup-dependencies.sh to install dependencies or install manually."
34+
exit 1
3535
fi
3636

3737
if [ -z ${BUILD_DIR+x} ]; then
38-
echo "BUILD_DIR environment variable not found. Assuming default: build"
39-
export BUILD_DIR=build
40-
if [ ! -d "${BUILD_DIR}" ]; then
41-
echo "${BUILD_DIR} directory not found. Please set BUILD_DIR or run \`export BUILD_DIR=${BUILD_DIR}; build.sh\` before linting."
42-
exit 1
43-
fi
38+
echo "BUILD_DIR environment variable not found. Assuming default: build"
39+
export BUILD_DIR=build
40+
if [ ! -d "${BUILD_DIR}" ]; then
41+
echo "${BUILD_DIR} directory not found. Please set BUILD_DIR or run \`export BUILD_DIR=${BUILD_DIR}; build.sh\` before linting."
42+
exit 1
43+
fi
4444
fi
4545

4646
python3 /usr/local/bin/run-clang-tidy.py -p ${BUILD_DIR} "tests/.*/.*\.cpp|src/.*/.*\.cpp|tools/.*/.*\.cpp"

scripts/setup-dependencies.sh

+24-24
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ mkdir -p $PREFIX $PREFIX/lib $PREFIX/include
1717

1818
CMAKE_BUILD_TYPE="Debug"
1919
if [[ "$BUILD_RELEASE" == "1" ]]; then
20-
CMAKE_BUILD_TYPE="Release"
20+
CMAKE_BUILD_TYPE="Release"
2121
fi
2222

2323
CPUS=1
2424
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
25-
CPUS=$(grep -c ^processor /proc/cpuinfo)
25+
CPUS=$(grep -c ^processor /proc/cpuinfo)
2626
elif [[ "$OSTYPE" == "darwin"* ]]; then
27-
CPUS=$(sysctl -n hw.ncpu)
27+
CPUS=$(sysctl -n hw.ncpu)
2828
fi
2929

3030
LEVELDB_VERSION="1.23"
@@ -50,12 +50,12 @@ mv NuRaft-${NURAFT_VERSION} "NuRaft-${NURAFT_VERSION}-${CMAKE_BUILD_TYPE}"
5050
cd "NuRaft-${NURAFT_VERSION}-${CMAKE_BUILD_TYPE}"
5151
./prepare.sh
5252
if [[ "$BUILD_RELEASE" == "1" ]]; then
53-
# If we're doing a release build, remove the examples and tests
54-
rm -rf examples tests
55-
mkdir examples
56-
mkdir tests
57-
touch examples/CMakeLists.txt
58-
touch tests/CMakeLists.txt
53+
# If we're doing a release build, remove the examples and tests
54+
rm -rf examples tests
55+
mkdir examples
56+
mkdir tests
57+
touch examples/CMakeLists.txt
58+
touch tests/CMakeLists.txt
5959
fi
6060
mkdir -p build
6161
cd build
@@ -78,18 +78,18 @@ make INSTALL_TOP=$PREFIX install
7878
cd ..
7979

8080
if [[ "$OSTYPE" != "darwin"* ]]; then
81-
# <NOTE> For Mac Silicon: this curl install creates problems for building tools/bench/parsec/evm/
82-
CURL_VERSION="7.83.1"
83-
wget https://curl.se/download/curl-${CURL_VERSION}.tar.gz
84-
rm -rf curl-${CURL_VERSION}
85-
tar xzvf curl-${CURL_VERSION}.tar.gz
86-
rm -rf curl-${CURL_VERSION}.tar.gz
87-
mkdir -p curl-${CURL_VERSION}/build
88-
cd curl-${CURL_VERSION}/build
89-
../configure --prefix="${PREFIX}" --disable-shared --without-ssl --without-libpsl --without-libidn2 --without-brotli --without-zstd --without-zlib
90-
make -j$CPUS
91-
make install
92-
cd ../..
81+
# <NOTE> For Mac Silicon: this curl install creates problems for building tools/bench/parsec/evm/
82+
CURL_VERSION="7.83.1"
83+
wget https://curl.se/download/curl-${CURL_VERSION}.tar.gz
84+
rm -rf curl-${CURL_VERSION}
85+
tar xzvf curl-${CURL_VERSION}.tar.gz
86+
rm -rf curl-${CURL_VERSION}.tar.gz
87+
mkdir -p curl-${CURL_VERSION}/build
88+
cd curl-${CURL_VERSION}/build
89+
../configure --prefix="${PREFIX}" --disable-shared --without-ssl --without-libpsl --without-libidn2 --without-brotli --without-zstd --without-zlib
90+
make -j$CPUS
91+
make install
92+
cd ../..
9393
fi
9494

9595
JSONCPP_VERSION="1.9.5"
@@ -130,10 +130,10 @@ rm -rf evmc
130130
mv ../evmc-${EVMC_VER} ./evmc
131131
mkdir ./evmc/.git
132132
if [[ "$OSTYPE" == "darwin"* ]]; then
133-
# Mac Silicon: clang 'ar' does not allow empty member list, fails w/ -DBUILD_SHARED_LIBS=OFF
134-
cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${PREFIX}"
133+
# Mac Silicon: clang 'ar' does not allow empty member list, fails w/ -DBUILD_SHARED_LIBS=OFF
134+
cmake -S . -B build -DCMAKE_INSTALL_PREFIX="${PREFIX}"
135135
else
136-
cmake -S . -B build -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="${PREFIX}"
136+
cmake -S . -B build -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="${PREFIX}"
137137
fi
138138
cmake --build build --parallel
139139
cd build

scripts/test-e2e-minikube.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ BUILD_DOCKER=${TESTRUN_BUILD_DOCKER:-1}
88
# Make sure we have the necessary tools installed
99
required_executables=(minikube docker go helm kubectl)
1010
for e in ${required_executables[@]}; do
11-
if ! command -v $e &> /dev/null; then
12-
echo "'$e' command not be found! This is required to run. Please install it."
13-
exit 1
14-
fi
11+
if ! command -v $e &> /dev/null; then
12+
echo "'$e' command not be found! This is required to run. Please install it."
13+
exit 1
14+
fi
1515
done
1616

1717
# Start minikube cluster with opencbdc profile
1818
minikube_status=$(minikube -p $MINIKUBE_PROFILE status | grep apiserver | awk '{ print $2 }')
1919
if [ "$minikube_status" != "Running" ]; then
20-
echo "🔄 Starting minkube cluster with profile '$MINIKUBE_PROFILE'..."
21-
minikube -p $MINIKUBE_PROFILE start
20+
echo "🔄 Starting minkube cluster with profile '$MINIKUBE_PROFILE'..."
21+
minikube -p $MINIKUBE_PROFILE start
2222
else
23-
echo "✅ minikube cluster with profile '$MINIKUBE_PROFILE' is currently running."
23+
echo "✅ minikube cluster with profile '$MINIKUBE_PROFILE' is currently running."
2424
fi
2525

2626
# Update Kubernetes context to default to this minikube cluster profile

0 commit comments

Comments
 (0)