From e5a6f2be41bf6c5c1f3c317fd77d3d111dfa4b5a Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Mon, 6 Jan 2025 08:55:21 -0800 Subject: [PATCH] Turn off the error message for requiring a certain version to use a custom step, let CI tell us how it goes. --- .../com/diffplug/gradle/spotless/FormatExtension.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/FormatExtension.java b/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/FormatExtension.java index 69150724c1..340953c15d 100644 --- a/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/FormatExtension.java +++ b/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/FormatExtension.java @@ -16,8 +16,6 @@ package com.diffplug.gradle.spotless; import static com.diffplug.gradle.spotless.PluginGradlePreconditions.requireElementsNonNull; -import static com.diffplug.gradle.spotless.SpotlessPluginRedirect.badSemver; -import static com.diffplug.gradle.spotless.SpotlessPluginRedirect.badSemverOfGradle; import static java.util.Objects.requireNonNull; import java.io.File; @@ -46,7 +44,6 @@ import org.gradle.api.file.FileCollection; import org.gradle.api.plugins.BasePlugin; import org.gradle.api.tasks.TaskProvider; -import org.gradle.util.GradleVersion; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -487,12 +484,6 @@ private void readObject(java.io.ObjectInputStream stream) throws java.io.IOExcep */ public void custom(String name, FormatterFunc formatter) { requireNonNull(formatter, "formatter"); - if (badSemverOfGradle() < badSemver(SpotlessPlugin.VER_GRADLE_minVersionForCustom)) { - throw new GradleException("The 'custom' method is only available if you are using Gradle " - + SpotlessPlugin.VER_GRADLE_minVersionForCustom - + " or newer, this is " - + GradleVersion.current().getVersion()); - } addStep(FormatterStep.createLazy(name, () -> globalState, SerializedFunction.alwaysReturns(formatter))); }