From 161cf7f5d92abba0b1b862d7aaa0939cb69d42bb Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 30 Nov 2018 21:01:29 -0500 Subject: [PATCH] shellcheck fix rc.autostart return and improve globbing --- Makefile | 2 +- ROMFS/CMakeLists.txt | 3 ++- Tools/px4airframes/rcout.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b70aa516ac..91ca65ae00 100644 --- a/Makefile +++ b/Makefile @@ -401,7 +401,7 @@ cppcheck: px4_sitl_default shellcheck_all: @"$(SRC_DIR)"/Tools/run-shellcheck.sh "$(SRC_DIR)"/ROMFS/px4fmu_common/ - @make px4_fmu-v2_default shellcheck + @make px4_fmu-v5_default shellcheck validate_module_configs: @find "$(SRC_DIR)"/src/modules "$(SRC_DIR)"/src/drivers "$(SRC_DIR)"/src/lib -name *.yaml -type f -print0 | xargs -0 "$(SRC_DIR)"/Tools/validate_yaml.py --schema-file "$(SRC_DIR)"/validation/module_schema.yaml diff --git a/ROMFS/CMakeLists.txt b/ROMFS/CMakeLists.txt index 1162b68ac1..460c33b51a 100644 --- a/ROMFS/CMakeLists.txt +++ b/ROMFS/CMakeLists.txt @@ -188,6 +188,7 @@ set_target_properties(romfs PROPERTIES LINKER_LANGUAGE C) find_program(SHELLCHECK_PATH shellcheck) if(SHELLCHECK_PATH) + # TODO: fix SC2086, SC2166 add_custom_target(shellcheck COMMAND ${SHELLCHECK_PATH} --shell=sh @@ -195,7 +196,7 @@ if(SHELLCHECK_PATH) --exclude=SC2086 # SC2086: Double quote to prevent globbing and word splitting. --exclude=SC2166 # SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. --exclude=SC2154 # SC2154: is referenced but not assigned (NuttX uses different asssignment) - init.d/* + `find ${romfs_gen_root_dir}/init.d -type f` DEPENDS ${romfs_gen_root_dir}/init.d/rc.autostart WORKING_DIRECTORY ${romfs_gen_root_dir} USES_TERMINAL diff --git a/Tools/px4airframes/rcout.py b/Tools/px4airframes/rcout.py index 4b0db3c405..c9d79723d3 100644 --- a/Tools/px4airframes/rcout.py +++ b/Tools/px4airframes/rcout.py @@ -30,7 +30,7 @@ class RCOutput(): "# 14000 .. 14999 Tri Y\n" "" "" - "cd /etc/init.d/airframes\n" + "cd /etc/init.d/airframes || return\n" "\n") for group in groups: result += "# GROUP: %s\n\n" % group.GetName()