diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 354984d6..570912e2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -65,6 +65,14 @@ updates: interval: "weekly" open-pull-requests-limit: 10 + - package-ecosystem: "gradle" + commit-message: + prefix: "deps(java)" + directory: "/dependencies/ktlint" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + # Maintain dev dependencies for docker - package-ecosystem: "docker" commit-message: diff --git a/Dockerfile b/Dockerfile index 5fec4267..c0f42d72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -252,7 +252,6 @@ RUN /install-clj-kondo.sh && rm -rf /install-clj-kondo.sh ################## # Install ktlint # ################## -ARG KTLINT_VERSION='0.47.1' COPY scripts/install-ktlint.sh / RUN --mount=type=secret,id=GITHUB_TOKEN /install-ktlint.sh && rm -rf /install-ktlint.sh diff --git a/dependencies/ktlint/build.gradle b/dependencies/ktlint/build.gradle new file mode 100644 index 00000000..8718b818 --- /dev/null +++ b/dependencies/ktlint/build.gradle @@ -0,0 +1,12 @@ +repositories { + mavenLocal() + mavenCentral() +} + +// Hold this dependency here so we can get automated updates using DependaBot +dependencies { + implementation 'com.pinterest.ktlint:ktlint-cli:0.47.1' +} + +group 'com.github.super-linter' +version '1.0.0-SNAPSHOT' diff --git a/scripts/install-ktlint.sh b/scripts/install-ktlint.sh index a69d573b..41f3b0bf 100755 --- a/scripts/install-ktlint.sh +++ b/scripts/install-ktlint.sh @@ -2,6 +2,12 @@ set -euo pipefail +KTLINT_VERSION="$( + set -euo pipefail + grep <"ktlint/build.gradle" "ktlint" | awk -F ':' '{print $3}' | tr -d "'" +)" +echo "Installing Ktlint: ${KTLINT_VERSION}" + url=$( set -euo pipefail curl -s \