mirror of
https://github.com/netdata/netdata.git
synced 2025-04-16 02:24:15 +00:00
automatic shellchecking on .sh.in scripts (#5165)
* CI linting .sh.in files * make linter passing
This commit is contained in:
parent
1509e49701
commit
06a367d876
4 changed files with 8 additions and 3 deletions
|
@ -21,6 +21,8 @@ jobs:
|
||||||
env: CFLAGS='-O1 -DNETDATA_INTERNAL_CHECKS=1 -DNETDATA_VERIFY_LOCKS=1'
|
env: CFLAGS='-O1 -DNETDATA_INTERNAL_CHECKS=1 -DNETDATA_VERIFY_LOCKS=1'
|
||||||
- name: dashboard.js
|
- name: dashboard.js
|
||||||
script: cp web/gui/dashboard.js /tmp/dashboard.js && ./build/build.sh && diff /tmp/dashboard.js web/gui/dashboard.js
|
script: cp web/gui/dashboard.js /tmp/dashboard.js && ./build/build.sh && diff /tmp/dashboard.js web/gui/dashboard.js
|
||||||
|
- name: lint .sh.in files
|
||||||
|
script: shellcheck --format=gcc $(find . -name '*.sh.in' -not -iwholename '*.git*')
|
||||||
- name: coverity
|
- name: coverity
|
||||||
install: sudo apt-get install -y zlib1g-dev uuid-dev libipmimonitoring-dev libmnl-dev libnetfilter-acct-dev
|
install: sudo apt-get install -y zlib1g-dev uuid-dev libipmimonitoring-dev libmnl-dev libnetfilter-acct-dev
|
||||||
script: ./coverity-scan.sh || echo "Coverity failed :("
|
script: ./coverity-scan.sh || echo "Coverity failed :("
|
||||||
|
|
|
@ -216,6 +216,7 @@ show_fireqos_names() {
|
||||||
#shellcheck source=/dev/null
|
#shellcheck source=/dev/null
|
||||||
source "${fireqos_run_dir}/${name}.conf"
|
source "${fireqos_run_dir}/${name}.conf"
|
||||||
for n in ${interface_classes_monitor}; do
|
for n in ${interface_classes_monitor}; do
|
||||||
|
# shellcheck disable=SC2086
|
||||||
setclassname ${n//|/ }
|
setclassname ${n//|/ }
|
||||||
done
|
done
|
||||||
[ -n "${interface_dev}" ] && echo "SETDEVICEGROUP ${interface_dev}"
|
[ -n "${interface_dev}" ] && echo "SETDEVICEGROUP ${interface_dev}"
|
||||||
|
|
|
@ -111,7 +111,7 @@ debug() {
|
||||||
|
|
||||||
docurl() {
|
docurl() {
|
||||||
if [ -z "${curl}" ]; then
|
if [ -z "${curl}" ]; then
|
||||||
error '${curl} is unset.'
|
error "${curl} is unset."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -216,7 +216,8 @@ else
|
||||||
units="${17}" # the units of the value
|
units="${17}" # the units of the value
|
||||||
info="${18}" # a short description of the alarm
|
info="${18}" # a short description of the alarm
|
||||||
value_string="${19}" # friendly value (with units)
|
value_string="${19}" # friendly value (with units)
|
||||||
# shellcheck disable=SC2034 variable is unused, but https://github.com/netdata/netdata/pull/5164#discussion_r255572947
|
# shellcheck disable=SC2034
|
||||||
|
# variable is unused, but https://github.com/netdata/netdata/pull/5164#discussion_r255572947
|
||||||
old_value_string="${20}" # friendly old value (with units), previously named "old_value_string"
|
old_value_string="${20}" # friendly old value (with units), previously named "old_value_string"
|
||||||
calc_expression="${21}" # contains the expression that was evaluated to trigger the alarm
|
calc_expression="${21}" # contains the expression that was evaluated to trigger the alarm
|
||||||
calc_param_values="${22}" # the values of the parameters in the expression, at the time of the evaluation
|
calc_param_values="${22}" # the values of the parameters in the expression, at the time of the evaluation
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# shellcheck disable=SC1117,SC2034,SC2059,SC2086,SC2181
|
||||||
|
|
||||||
NETDATA_USER_CONFIG_DIR="@configdir_POST@"
|
NETDATA_USER_CONFIG_DIR="@configdir_POST@"
|
||||||
NETDATA_STOCK_CONFIG_DIR="@libconfigdir_POST@"
|
NETDATA_STOCK_CONFIG_DIR="@libconfigdir_POST@"
|
||||||
|
@ -260,4 +261,4 @@ fi
|
||||||
if [ $err -gt 0 ] ; then
|
if [ $err -gt 0 ] ; then
|
||||||
echo "$err error(s) found"
|
echo "$err error(s) found"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue