]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
new: don't mandate double square brackets
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 28 Jul 2023 11:07:17 +0000 (20:07 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 11 Aug 2023 01:32:10 +0000 (10:32 +0900)
It was guided for test statements in blktests scripts to use double
square brackets [[ ]] form instead of single square brackets [ ] form.
However, a number of patch contributors use [ ]. It is not productive to
replace them with [[ ]] and discouraging contributions. To avoid those
drawbacks, allow both forms and still keep [[ ]] as the preferred form.
While at it, fix a typo.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
new

diff --git a/new b/new
index e8ee5a05c2065d77a4f8a9e70e0f3bbb7842f9a4..574d8b43c055c64cdbfa6de7dff8731dc323a6ec 100755 (executable)
--- a/new
+++ b/new
@@ -232,7 +232,7 @@ test() {
        echo "Test complete"
 }
 
-# Finally, some coding style guidlines:
+# Finally, some coding style guidelines:
 # - Indent with tabs.
 # - Don't add a space before the parentheses or a newline before the curly brace
 #   in function definitions.
@@ -242,7 +242,7 @@ test() {
 # - Functions defined by the testing framework or group scripts, including
 #   helpers, have a leading underscore. E.g., _have_scsi_debug. Functions local
 #   to the test should not have a leading underscore.
-# - Use the bash [[ ]] form of tests instead of [ ].
+# - Both [[ ]] form and [ ] form are fine for tests. [[ ]] is preferred.
 # - Always quote variable expansions unless the variable is a number or inside of
 #   a [[ ]] test.
 # - Use the \$() form of command substitution instead of backticks.