[glib: 2/4] Correct shellcheck errors (and ignore world splitting when we want it)




commit e817a049f0bdce0214d90095b9a58f31a1f7ba9c
Author: Frederic Martinsons <frederic martinsons sigfox com>
Date:   Wed Nov 11 09:50:31 2020 +0100

    Correct shellcheck errors (and ignore world splitting when we want it)
    
    Signed-off-by: Frederic Martinsons <frederic martinsons sigfox com>

 .gitlab-ci/run-black.sh                      | 1 +
 .gitlab-ci/run-flake8.sh                     | 1 +
 .gitlab-ci/run-shellcheck.sh                 | 1 +
 check-abis.sh                                | 4 ++--
 gio/tests/x-content/unix-software/autorun.sh | 2 +-
 tests/run-assert-msg-test.sh                 | 1 +
 6 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/.gitlab-ci/run-black.sh b/.gitlab-ci/run-black.sh
index 35ecec527..fdeaf1684 100755
--- a/.gitlab-ci/run-black.sh
+++ b/.gitlab-ci/run-black.sh
@@ -2,4 +2,5 @@
 
 set -e
 
+# shellcheck disable=SC2046
 black --diff --check $(git ls-files '*.py')
diff --git a/.gitlab-ci/run-flake8.sh b/.gitlab-ci/run-flake8.sh
index 1776cad97..2a7628303 100755
--- a/.gitlab-ci/run-flake8.sh
+++ b/.gitlab-ci/run-flake8.sh
@@ -2,4 +2,5 @@
 
 set -e
 
+# shellcheck disable=SC2046
 flake8 --max-line-length=88 $(git ls-files '*.py')
diff --git a/.gitlab-ci/run-shellcheck.sh b/.gitlab-ci/run-shellcheck.sh
index f6d2dd59f..abf2e5ef3 100755
--- a/.gitlab-ci/run-shellcheck.sh
+++ b/.gitlab-ci/run-shellcheck.sh
@@ -3,4 +3,5 @@
 set -e
 
 # Ignoring third-party directories that we don't want to parse
+# shellcheck disable=SC2046
 shellcheck $(git ls-files '*.sh' | grep -Ev "glib/libcharset|glib/dirent")
diff --git a/check-abis.sh b/check-abis.sh
index a18103bf8..5340f317d 100755
--- a/check-abis.sh
+++ b/check-abis.sh
@@ -1,11 +1,11 @@
 #!/bin/sh -e
 
 list_leaked_symbols () {
-       nm -D "$1" | grep ' T ' | cut -f 3 -d ' ' | egrep -v "$2"
+       nm -D "$1" | grep ' T ' | cut -f 3 -d ' ' | grep -E -v "$2"
 }
 
 check_symbols () {
-       if [ "`list_leaked_symbols "$1" "$2" | wc -l`" -ne 0 ]; then
+       if [ "$(list_leaked_symbols "$1" "$2" | wc -l)" -ne 0 ]; then
                echo File "$1" possibly leaking symbols:
                list_leaked_symbols "$1" "$2"
                exit 1
diff --git a/gio/tests/x-content/unix-software/autorun.sh b/gio/tests/x-content/unix-software/autorun.sh
index 6dfc55944..ef09a62a6 100644
--- a/gio/tests/x-content/unix-software/autorun.sh
+++ b/gio/tests/x-content/unix-software/autorun.sh
@@ -1,3 +1,3 @@
 #! /bin/sh
 
-do something here
+# do something here
diff --git a/tests/run-assert-msg-test.sh b/tests/run-assert-msg-test.sh
index 526c75a81..88f86f1e2 100755
--- a/tests/run-assert-msg-test.sh
+++ b/tests/run-assert-msg-test.sh
@@ -41,6 +41,7 @@ echo_v "Running gdb on assert-msg-test"
 OUT=$($LIBTOOL --mode=execute gdb --batch -x "${srcdir:-.}/assert-msg-test.gdb" ./assert-msg-test 2> 
$error_out) || fail "failed to run gdb"
 
 echo_v "Checking if assert message is in __glib_assert_msg"
+# shellcheck disable=SC2016
 if ! echo "$OUT" | grep -q '^$1.*"GLib:ERROR:.*assert-msg-test.c:.*:.*main.*: assertion failed: (42 < 0)"'; 
then
   fail "__glib_assert_msg does not have assertion message"
 fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]