@@ -5,7 +5,7 @@ detekt_formatting="/opt/detekt-formatting.jar"
55# cd or fail
66cd " $GITHUB_WORKSPACE " || exit 1
77# Fixes https://github.com/reviewdog/reviewdog/issues/1158
8- git config --global --add safe.directory $GITHUB_WORKSPACE || exit 1
8+ git config --global --add safe.directory " $GITHUB_WORKSPACE " || exit 1
99
1010if [ " $INPUT_FAIL_ON_ERROR " = true ] ; then
1111 set -o pipefail
@@ -19,33 +19,40 @@ detekt_command+="--report xml:detekt_report.xml "
1919detekt_command+=" --excludes ${INPUT_DETEKT_EXCLUDES} "
2020
2121if [ -z " $INPUT_DETEKT_PLUGINS " ]; then
22- detekt_command+=" --plugins ${detekt_formatting} "
22+ detekt_command+=" --plugins \" ${detekt_formatting} \" "
2323else
24- detekt_command+=" --plugins ${detekt_formatting} ,${INPUT_DETEKT_PLUGINS} "
24+ detekt_command+=" --plugins \" ${detekt_formatting} ,${INPUT_DETEKT_PLUGINS} \" "
2525fi
2626
27+ # Baseline
2728if [ -n " $INPUT_DETEKT_BASELINE " ]; then
28- detekt_command+=" --baseline ${INPUT_DETEKT_BASELINE} "
29+ detekt_command+=" --baseline \" ${INPUT_DETEKT_BASELINE} \" "
2930fi
3031
32+ # Parallel (boolean-ish input)
3133if [ -n " $INPUT_DETEKT_PARALLEL " ]; then
32- detekt_command+=" --parallel "
34+ detekt_command+=" --parallel"
3335fi
3436
35- if [ -n " $DETEKT_INPUT_BUILD_UPON_DEFAULT_CONFIG " ]; then
36- detekt_command+=" --build-upon-default-config "
37+ # Build upon default config (fixed var name)
38+ if [ -n " $INPUT_DETEKT_BUILD_UPON_DEFAULT_CONFIG " ]; then
39+ detekt_command+=" --build-upon-default-config"
3740fi
3841
39- if [ -n " $DETEKT_ALL_RULES " ]; then
40- detekt_command+=" --all-rules "
42+ # All rules (fixed var name)
43+ if [ -n " $INPUT_DETEKT_ALL_RULES " ]; then
44+ detekt_command+=" --all-rules"
4145fi
4246
43- if [ -n " $DETEKT_INPUT " ]; then
44- detekt_command+=" --input ${DETEKT_INPUT} "
47+ # Input paths (fixed var name)
48+ if [ -n " $INPUT_DETEKT_INPUT " ]; then
49+ detekt_command+=" --input \" ${INPUT_DETEKT_INPUT} \" "
4550fi
4651
52+ echo " Running detekt with command:"
4753echo " $detekt_command "
4854eval " $detekt_command "
4955
5056reviewdog -f=checkstyle -name=" detekt" -reporter=" ${INPUT_REVIEWDOG_REPORTER} " \
51- -level=" ${INPUT_REVIEWDOG_LEVEL} " -filter-mode=" ${INPUT_REVIEWDOG_FILTER} " < detekt_report.xml
57+ -level=" ${INPUT_REVIEWDOG_LEVEL} " -filter-mode=" ${INPUT_REVIEWDOG_FILTER} " \
58+ < detekt_report.xml
0 commit comments