From 8f6f40631bc8c73917ca30f3e59f632547c8f7ee Mon Sep 17 00:00:00 2001 From: Ghais Zaher Date: Mon, 16 Oct 2023 10:42:41 +0200 Subject: [PATCH] chore: drop code-style after v0.50.0 --- entrypoint.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 7190b34..4083d5f 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -37,10 +37,13 @@ ktlint_version=$(ktlint --version) echo "ktlint version: $ktlint_version" if [ "$(printf '%s\n' "0.49.1" "$ktlint_version" | sort -V | head -n1)" = "0.49.1" ]; then - if [ "$INPUT_ANDROID" = true ]; then - export ANDROID="--code-style=android_studio" - else - export ANDROID="--code-style=intellij_idea" + # --code-style is deprecated and .editorconfig needs to be used: https://pinterest.github.io/ktlint/latest/rules/code-styles/ + if [ "$(printf '%s\n' "0.50.0" "$ktlint_version" | sort -V | head -n1)" = "0.50.0" ]; then + if [ "$INPUT_ANDROID" = true ]; then + export ANDROID="--code-style=android_studio" + else + export ANDROID="--code-style=intellij_idea" + fi fi else if [ "$INPUT_ANDROID" = true ]; then @@ -55,4 +58,3 @@ ktlint --reporter=checkstyle $CUSTOM_RULE_PATH $RELATIVE $ANDROID $BASELINE $INP -level="${INPUT_LEVEL}" \ -filter-mode="${INPUT_FILTER_MODE}" \ -fail-on-error="${INPUT_FAIL_ON_ERROR}" -