Skip to content

Commit ca96371

Browse files
committed
Fix false positives in shellcheck tests
Shellcheck became very smart, and it can detect that if there are only action optional args that exit upon call, there is no need for a 'for' to loop through args and, specifically, for 'shift' after 'case'.
1 parent e36d011 commit ca96371

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

tests/regressiontests/test-env-base.m4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
# SC2317: Command appears to be unreachable
4+
# When there are only action optional arguments and no positional ones, the shift statement can be omitted.
5+
# The check smells risky, and its value is very low.
6+
# shellcheck disable=SC2317
7+
#
38
# ARG_USE_ENV([ENVI_FOO], [def,ault], [A sample env, variable])
49
# ARG_USE_ENV([ENVI_BAR], [], [A sample env, variable])
510
# ARG_HELP()

tests/regressiontests/test-env-simple.m4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
# SC2317: Command appears to be unreachable
4+
# When there are only action optional arguments and no positional ones, the shift statement can be omitted.
5+
# The check smells risky, and its value is very low.
6+
# shellcheck disable=SC2317
7+
#
38
# ARG_USE_ENV([ENVI_FOO], [def,ault])
49
# ARG_HELP()
510
# ARGBASH_GO

tests/regressiontests/test-prog.m4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash -e
22

3+
# SC2317: Command appears to be unreachable
4+
# When there are only action optional arguments and no positional ones, the shift statement can be omitted.
5+
# The check smells risky, and its value is very low.
6+
# shellcheck disable=SC2317
7+
#
38
# ARG_VERSION([echo "$0 FOO"])
49
# ARG_USE_PROGRAM([fulala], [FULALA], [fulala doesnt exist], [Testing program m4_fatal(BOOM!)])
510
# ARG_HELP([Testing program m4_fatal(BOOM!)], [m4_fatal([CRASH!])])

tests/regressiontests/test-progs.m4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash -e
22

3+
# SC2317: Command appears to be unreachable
4+
# When there are only action optional arguments and no positional ones, the shift statement can be omitted.
5+
# The check smells risky, and its value is very low.
6+
# shellcheck disable=SC2317
7+
#
38
# ARG_VERSION([echo "$0 FOO"])
49
# ARG_USE_PROGRAM([fulala], [FULALA], [fulala doesnt exist], [Testing program m4_fatal(BOOM!)])
510
# ARG_USE_PROGRAM([make], [MAKE], [GNU make missing], [GNU make - utility used for automation])

0 commit comments

Comments
 (0)