Skip to content

Commit

Permalink
Turn off the error message for requiring a certain version to use a c…
Browse files Browse the repository at this point in the history
…ustom step, let CI tell us how it goes.
  • Loading branch information
nedtwigg committed Jan 6, 2025
1 parent 9c9cac0 commit e5a6f2b
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)));
}

Expand Down

0 comments on commit e5a6f2b

Please sign in to comment.