mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
shellcheck: disable SC2181
The combination of 'if mycmd' and a logical expression is not supported in NuttX.
This commit is contained in:
@@ -260,6 +260,7 @@ if(SHELLCHECK_PATH)
|
|||||||
--exclude=SC2166 # SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
|
--exclude=SC2166 # SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
|
||||||
--exclude=SC2154 # SC2154: <var> is referenced but not assigned (NuttX uses different asssignment)
|
--exclude=SC2154 # SC2154: <var> is referenced but not assigned (NuttX uses different asssignment)
|
||||||
--exclude=SC2164 # SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
|
--exclude=SC2164 # SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
|
||||||
|
--exclude=SC2181 # SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
|
||||||
`find ${romfs_gen_root_dir}/init.d -type f`
|
`find ${romfs_gen_root_dir}/init.d -type f`
|
||||||
DEPENDS ${romfs_gen_root_dir}/init.d/rc.autostart
|
DEPENDS ${romfs_gen_root_dir}/init.d/rc.autostart
|
||||||
WORKING_DIRECTORY ${romfs_gen_root_dir}
|
WORKING_DIRECTORY ${romfs_gen_root_dir}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ echo "Running shellcheck in '$search_directory'."
|
|||||||
# SC2166: allow the form [ $OUTPUT_MODE == fmu -o $OUTPUT_MODE == io ]
|
# SC2166: allow the form [ $OUTPUT_MODE == fmu -o $OUTPUT_MODE == io ]
|
||||||
# SC2148: allow files w/o shebang
|
# SC2148: allow files w/o shebang
|
||||||
# SC2039: In POSIX sh, array references are undefined. TODO: fix this
|
# SC2039: In POSIX sh, array references are undefined. TODO: fix this
|
||||||
|
# SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
|
||||||
shellcheck -x \
|
shellcheck -x \
|
||||||
-e SC1008 \
|
-e SC1008 \
|
||||||
-e SC2086 \
|
-e SC2086 \
|
||||||
@@ -32,6 +33,7 @@ shellcheck -x \
|
|||||||
-e SC2148 \
|
-e SC2148 \
|
||||||
-e SC2166 \
|
-e SC2166 \
|
||||||
-e SC2039 \
|
-e SC2039 \
|
||||||
|
-e SC2181 \
|
||||||
--shell=dash \
|
--shell=dash \
|
||||||
$scripts
|
$scripts
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|||||||
Reference in New Issue
Block a user