Messages in this thread Patch in this message | | | Date | Mon, 8 Apr 2024 19:32:15 -0700 | Subject | [PATCH v1 3/4] perf util: Add shellcheck to generate-cmdlist.sh | From | Ian Rogers <> |
| |
Add shellcheck to generate-cmdlist.sh to avoid basic shell script mistakes.
Signed-off-by: Ian Rogers <irogers@google.com> --- tools/perf/util/Build | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/tools/perf/util/Build b/tools/perf/util/Build index aec5a590e349..292170a99ab6 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -389,3 +389,17 @@ $(OUTPUT)util/vsprintf.o: ../lib/vsprintf.c FORCE $(OUTPUT)util/list_sort.o: ../lib/list_sort.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c) + +ifdef SHELLCHECK + SHELL_TESTS := generate-cmdlist.sh + TEST_LOGS := $(SHELL_TESTS:%=%.shellcheck_log) +else + SHELL_TESTS := + TEST_LOGS := +endif + +$(OUTPUT)%.shellcheck_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)shellcheck -a -S warning "$<" > $@ || (cat $@ && rm $@ && false) + +perf-y += $(TEST_LOGS) -- 2.44.0.478.gd926399ef9-goog
| |