automatic shellchecking on .sh.in scripts (#5165)
* CI linting .sh.in files * make linter passing
Paweł Krupa committed
Feb 12, 2019 at 14:12 UTC
06a367d8762915f3cd5e06971c46e4d1535d3ae9
4 files changed
+8
-3
.travis.yml
+2
@@ -21,6 +21,8 @@ jobs:
21
env: CFLAGS='-O1 -DNETDATA_INTERNAL_CHECKS=1 -DNETDATA_VERIFY_LOCKS=1'
22
- name: dashboard.js
23
script: cp web/gui/dashboard.js /tmp/dashboard.js && ./build/build.sh && diff /tmp/dashboard.js web/gui/dashboard.js
24
+ - name: lint .sh.in files
25
+ script: shellcheck --format=gcc $(find . -name '*.sh.in' -not -iwholename '*.git*')
26
- name: coverity
27
install: sudo apt-get install -y zlib1g-dev uuid-dev libipmimonitoring-dev libmnl-dev libnetfilter-acct-dev
28
script: ./coverity-scan.sh || echo "Coverity failed :("
collectors/tc.plugin/tc-qos-helper.sh.in
+1
@@ -216,6 +216,7 @@ show_fireqos_names() {
216
#shellcheck source=/dev/null
217
source "${fireqos_run_dir}/${name}.conf"
218
for n in ${interface_classes_monitor}; do
219
+ # shellcheck disable=SC2086
220
setclassname ${n//|/ }
221
done
222
[ -n "${interface_dev}" ] && echo "SETDEVICEGROUP ${interface_dev}"
health/notifications/alarm-notify.sh.in
+3
-2
@@ -111,7 +111,7 @@ debug() {
111
112
docurl() {
113
if [ -z "${curl}" ]; then
114
- error '${curl} is unset.'
114
+ error "${curl} is unset."
115
return 1
116
fi
117
@@ -216,7 +216,8 @@ else
216
units="${17}" # the units of the value
217
info="${18}" # a short description of the alarm
218
value_string="${19}" # friendly value (with units)
219
- # shellcheck disable=SC2034 variable is unused, but https://github.com/netdata/netdata/pull/5164#discussion_r255572947
219
+ # shellcheck disable=SC2034
220
+ # variable is unused, but https://github.com/netdata/netdata/pull/5164#discussion_r255572947
221
old_value_string="${20}" # friendly old value (with units), previously named "old_value_string"
222
calc_expression="${21}" # contains the expression that was evaluated to trigger the alarm
223
calc_param_values="${22}" # the values of the parameters in the expression, at the time of the evaluation
tests/health_mgmtapi/health-cmdapi-test.sh.in
+2
-1
@@ -1,4 +1,5 @@
1
#!/usr/bin/env bash
2
+# shellcheck disable=SC1117,SC2034,SC2059,SC2086,SC2181
3
4
NETDATA_USER_CONFIG_DIR="@configdir_POST@"
5
NETDATA_STOCK_CONFIG_DIR="@libconfigdir_POST@"
@@ -260,4 +261,4 @@ fi
261
if [ $err -gt 0 ] ; then
262
echo "$err error(s) found"
263
exit 1
263
-fi
\ No newline at end of file
264
+fi