Skip to content

Commit 8322ee7

Browse files
authored
Fix all issues from shellcheck --severity=warning (#2354)
1 parent e84bfff commit 8322ee7

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

.github/workflows/shellcheck.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Shellcheck
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'release/*'
7+
pull_request:
8+
9+
jobs:
10+
shellcheck:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install shellcheck
16+
run: sudo apt update && sudo apt install --assume-yes shellcheck
17+
18+
- name: Run shellcheck
19+
run: find . -name \*.sh | xargs shellcheck --severity=warning

exporter/opentelemetry-exporter-prometheus-remote-write/proto/generate-proto-py.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ PROTO_VERSION=v1.3.2
66

77
# SRC_DIR is from protoc perspective. ie its the destination for our checkouts/clones
88
SRC_DIR=opentelemetry/exporter/prometheus_remote_write/gen/
9-
DST_DIR=../src/opentelemetry/exporter/prometheus_remote_write/gen/
109

1110
#TODO:
1211
# Check that black & protoc are installed properly

scripts/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ set -ev
88
# Get the latest versions of packaging tools
99
python3 -m pip install --upgrade pip build setuptools wheel
1010

11-
BASEDIR=$(dirname $(readlink -f $(dirname $0)))
11+
BASEDIR=$(dirname "$(readlink -f "$(dirname $0)")")
1212
DISTDIR=dist
1313

1414
(
1515
cd $BASEDIR
1616
mkdir -p $DISTDIR
17-
rm -rf $DISTDIR/*
17+
rm -rf ${DISTDIR:?}/*
1818

1919
for d in exporter/*/ opentelemetry-instrumentation/ opentelemetry-contrib-instrumentations/ opentelemetry-distro/ instrumentation/*/ propagator/*/ resource/*/ sdk-extension/*/ util/*/ ; do
2020
(

scripts/build_a_package.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set -ev
2222

2323
if [ -z $GITHUB_REF ]; then
2424
echo 'Failed to run script, missing workflow env variable GITHUB_REF.'
25-
exit -1
25+
exit 1
2626
fi
2727

2828
pkg_name_and_version=${GITHUB_REF#refs/tags/*}
@@ -40,13 +40,13 @@ cd $basedir
4040

4141
distdir=${basedir}/dist
4242
mkdir -p $distdir
43-
rm -rf $distdir/*
43+
rm -rf ${distdir:?}/*
4444

4545
pyproject_toml_file_path=$(ls **/$pkg_name/pyproject.toml)
4646

4747
if [ -z $pyproject_toml_file_path ]; then
4848
echo "Error! pyproject.toml not found for $pkg_name, can't build."
49-
exit -1
49+
exit 1
5050
fi
5151

5252
directory_with_package=$(dirname $pyproject_toml_file_path)
@@ -61,7 +61,7 @@ pkg_tar_gz_file=${pkg_name}-${pkg_version}.tar.gz
6161

6262
if ! [ -f $pkg_tar_gz_file ]; then
6363
echo 'Error! Tag version does not match version built using latest package files.'
64-
exit -1
64+
exit 1
6565
fi
6666

6767
# Build a wheel for the source distribution

scripts/coverage.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ function cov {
1111
${1}
1212
}
1313

14-
PYTHON_VERSION=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')
15-
PYTHON_VERSION_INFO=(${PYTHON_VERSION//./ })
16-
1714
coverage erase
1815

1916
cov instrumentation/opentelemetry-instrumentation-flask

0 commit comments

Comments
 (0)