mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-28 04:34:01 +08:00
Fix all issues from shellcheck --severity=warning (#2354)
This commit is contained in:
19
.github/workflows/shellcheck.yml
vendored
Normal file
19
.github/workflows/shellcheck.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
name: Shellcheck
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'release/*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
shellcheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install shellcheck
|
||||
run: sudo apt update && sudo apt install --assume-yes shellcheck
|
||||
|
||||
- name: Run shellcheck
|
||||
run: find . -name \*.sh | xargs shellcheck --severity=warning
|
@ -6,7 +6,6 @@ PROTO_VERSION=v1.3.2
|
||||
|
||||
# SRC_DIR is from protoc perspective. ie its the destination for our checkouts/clones
|
||||
SRC_DIR=opentelemetry/exporter/prometheus_remote_write/gen/
|
||||
DST_DIR=../src/opentelemetry/exporter/prometheus_remote_write/gen/
|
||||
|
||||
#TODO:
|
||||
# Check that black & protoc are installed properly
|
||||
|
@ -8,13 +8,13 @@ set -ev
|
||||
# Get the latest versions of packaging tools
|
||||
python3 -m pip install --upgrade pip build setuptools wheel
|
||||
|
||||
BASEDIR=$(dirname $(readlink -f $(dirname $0)))
|
||||
BASEDIR=$(dirname "$(readlink -f "$(dirname $0)")")
|
||||
DISTDIR=dist
|
||||
|
||||
(
|
||||
cd $BASEDIR
|
||||
mkdir -p $DISTDIR
|
||||
rm -rf $DISTDIR/*
|
||||
rm -rf ${DISTDIR:?}/*
|
||||
|
||||
for d in exporter/*/ opentelemetry-instrumentation/ opentelemetry-contrib-instrumentations/ opentelemetry-distro/ instrumentation/*/ propagator/*/ resource/*/ sdk-extension/*/ util/*/ ; do
|
||||
(
|
||||
|
@ -22,7 +22,7 @@ set -ev
|
||||
|
||||
if [ -z $GITHUB_REF ]; then
|
||||
echo 'Failed to run script, missing workflow env variable GITHUB_REF.'
|
||||
exit -1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pkg_name_and_version=${GITHUB_REF#refs/tags/*}
|
||||
@ -40,13 +40,13 @@ cd $basedir
|
||||
|
||||
distdir=${basedir}/dist
|
||||
mkdir -p $distdir
|
||||
rm -rf $distdir/*
|
||||
rm -rf ${distdir:?}/*
|
||||
|
||||
pyproject_toml_file_path=$(ls **/$pkg_name/pyproject.toml)
|
||||
|
||||
if [ -z $pyproject_toml_file_path ]; then
|
||||
echo "Error! pyproject.toml not found for $pkg_name, can't build."
|
||||
exit -1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
directory_with_package=$(dirname $pyproject_toml_file_path)
|
||||
@ -61,7 +61,7 @@ pkg_tar_gz_file=${pkg_name}-${pkg_version}.tar.gz
|
||||
|
||||
if ! [ -f $pkg_tar_gz_file ]; then
|
||||
echo 'Error! Tag version does not match version built using latest package files.'
|
||||
exit -1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build a wheel for the source distribution
|
||||
|
@ -11,9 +11,6 @@ function cov {
|
||||
${1}
|
||||
}
|
||||
|
||||
PYTHON_VERSION=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')
|
||||
PYTHON_VERSION_INFO=(${PYTHON_VERSION//./ })
|
||||
|
||||
coverage erase
|
||||
|
||||
cov instrumentation/opentelemetry-instrumentation-flask
|
||||
|
Reference in New Issue
Block a user