]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Avoid some shellcheck excludes that do make sense
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Mon, 11 Jun 2018 18:34:35 +0000 (20:34 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 11 Aug 2018 08:59:11 +0000 (10:59 +0200)
misc/shellcheck-excludes.txt
test/suites/base.bash
test/suites/hardlink.bash
test/suites/masquerading.bash

index 9c6aad62b6120e938fabfc84ba5affd549f1a95e..08d8fbd1f8266c0bfb51ada78ccec2fdcd9f054c 100644 (file)
@@ -4,7 +4,5 @@ SC2001: See if you can use ${variable//search/replace} instead.
 SC2006: Use $(..) instead of legacy `..`.
 SC2046: Quote this to prevent word splitting.
 SC2086: Double quote to prevent globbing and word splitting.
-SC2094: Make sure not to read and write the same file in the same pipeline.
 SC2103: Consider using ( subshell ), 'cd foo||exit', or pushd/popd instead.
-SC2155: Declare and assign separately to avoid masking return values.
 SC2129: Consider using { cmd1; cmd2; } >> file instead of individual redirects.
index 307100e84d3888519e20230370186e8f187450b8..f2c6cb8d1a0c426a3420675281928295c1763c05 100644 (file)
@@ -298,8 +298,8 @@ base_tests() {
     # -------------------------------------------------------------------------
     TEST "CCACHE_EXTRAFILES"
 
-    echo a >a
-    echo b >b
+    echo "a" >a
+    echo "b" >b
 
     $CCACHE_COMPILE -c test1.c
     expect_stat 'cache hit (preprocessed)' 0
index 8e7e8b0d5f5f18f175ac356bcf47e0c471a104d6..f4f969e3cfdeb74f023230adb55950e945cc9e0a 100644 (file)
@@ -25,7 +25,8 @@ SUITE_hardlink() {
     expect_stat 'files in cache' 1
     expect_equal_object_files reference_test1.o test1.o
 
-    local obj_in_cache=$(find $CCACHE_DIR -name '*.o')
+    local obj_in_cache
+    obj_in_cache=$(find $CCACHE_DIR -name '*.o')
     if [ ! $obj_in_cache -ef test1.o ]; then
         test_failed "Object file not hard-linked to cached object file"
     fi
index 0b42eef342eaafcbc8a9759a64a7cfc48e8f3628..fbbb78f27cdb84446d063bdc3f24993d94645071 100644 (file)
@@ -1,13 +1,16 @@
 SUITE_masquerading_PROBE() {
-    local compiler_binary=$(echo $COMPILER | cut -d' ' -f1)
+    local compiler_binary
+    compiler_binary=$(echo $COMPILER | cut -d' ' -f1)
     if [ "$(dirname $compiler_binary)" != . ]; then
         echo "compiler ($compiler_binary) not taken from PATH"
     fi
 }
 
 SUITE_masquerading_SETUP() {
-    local compiler_binary=$(echo $COMPILER | cut -d' ' -f1)
-    local compiler_args=$(echo $COMPILER | cut -s -d' ' -f2-)
+    local compiler_binary
+    compiler_binary=$(echo $COMPILER | cut -d' ' -f1)
+    local compiler_args
+    compiler_args=$(echo $COMPILER | cut -s -d' ' -f2-)
 
     ln -s "$CCACHE" $compiler_binary
     CCACHE_COMPILE="./$compiler_binary $compiler_args"