Skip to content

Commit 26e3f27

Browse files
committed
migrate to Diktat 2.0
1 parent b3fda22 commit 26e3f27

File tree

3 files changed

+9
-620
lines changed

3 files changed

+9
-620
lines changed

action.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,17 @@ runs:
8585
steps:
8686
- id: setup-java
8787
if: ${{ inputs.java-version != null }}
88-
uses: actions/setup-java@v3
88+
uses: actions/setup-java@v4
8989
with:
9090
distribution: '${{ inputs.java-distribution }}'
9191
java-version: ${{ inputs.java-version }}
9292

93-
- run: echo '${{ github.action_path }}/bin' >>${GITHUB_PATH}
94-
shell: bash
93+
- id: download-diktat
94+
uses: robinraju/release-downloader@v1.8
95+
with:
96+
repository: "nulls/diktat"
97+
tag: "v2.0.0"
98+
fileName: "diktat"
9599

96100
# GitHub seems to set `-e` internally, so don't fail immediately if diKTat
97101
# returns a non-zero exit code but store the exit code in a variable for
@@ -101,8 +105,7 @@ runs:
101105
# `steps.diktat.outputs.exit-code` variable.
102106
- id: diktat
103107
run: |
104-
DIKTAT_ARGS=('--config=${{ inputs.config }}')
105-
DIKTAT_ARGS=('--reporter=${{ inputs.reporter }}')
108+
DIKTAT_ARGS=('--config', '${{ inputs.config }}', '--reporter', '${{ inputs.reporter }}')
106109
if [[ '${{ inputs.color }}' != 'false' ]]
107110
then
108111
DIKTAT_ARGS+=('--color')
@@ -119,7 +122,7 @@ runs:
119122
set -o pipefail
120123
IFS=$'\n'
121124
INPUT_PATHS=(${{ inputs.input-paths }})
122-
{ diktat --no-download-progress --verbose "${DIKTAT_ARGS[@]}" "${INPUT_PATHS[@]}" | tee diktat.log; } && exit_code=$? || exit_code=$?
125+
{ diktat "${DIKTAT_ARGS[@]}" "${INPUT_PATHS[@]}" | tee diktat.log; } && exit_code=$? || exit_code=$?
123126
echo "summary-line=$(tail -n1 diktat.log 2>/dev/null)" >>$GITHUB_OUTPUT
124127
rm -f diktat.log
125128
echo "exit-code=${exit_code}" >>$GITHUB_OUTPUT

0 commit comments

Comments
 (0)