Skip to content

Commit 44b1ee4

Browse files
committed
Add deprecation warnings and javadoc to FormatExtension.
1 parent b2a52ef commit 44b1ee4

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/FormatExtension.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,23 +170,34 @@ public void setEncoding(Charset charset) {
170170

171171
final List<LintSuppression> lintSuppressions = new ArrayList<>();
172172

173+
/** Suppresses any lints which meet the supplied criteria. */
173174
public void suppressLintsFor(Action<LintSuppression> lintSuppression) {
174175
LintSuppression suppression = new LintSuppression();
175176
lintSuppression.execute(suppression);
176177
suppression.ensureDoesNotSuppressAll();
177178
lintSuppressions.add(suppression);
178179
}
179180

180-
/** Ignores errors in the given step. */
181+
/**
182+
* Ignores errors in the given step.
183+
*
184+
* @deprecated Use {@link #suppressLintsFor(Action)} instead.
185+
*/
181186
@Deprecated
182187
public void ignoreErrorForStep(String stepName) {
188+
System.err.println("`ignoreErrorForStep('" + stepName + "') is deprecated, use `suppressLintsFor { step = '" + stepName + "' }` instead.");
183189
suppressLintsFor(it -> it.setStep(stepName));
184190
}
185191

186-
/** Ignores errors for the given relative path. */
192+
/**
193+
* Ignores errors for the given relative path.
194+
*
195+
* @deprecated Use {@link #suppressLintsFor(Action)} instead.
196+
*/
187197
@Deprecated
188198
public void ignoreErrorForPath(String relativePath) {
189-
suppressLintsFor(it -> it.setFile(relativePath));
199+
System.err.println("`ignoreErrorForPath('" + relativePath + "') is deprecated, use `suppressLintsFor { path = '" + relativePath + "' }` instead.");
200+
suppressLintsFor(it -> it.setPath(relativePath));
190201
}
191202

192203
/**

0 commit comments

Comments
 (0)