Skip to content

Commit c1a2fe5

Browse files
committed
Fix unfinished parts of the rename.
1 parent cd0c79d commit c1a2fe5

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

plugin-maven/src/main/java/com/diffplug/spotless/maven/java/Java.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void addRemoveUnusedImports(RemoveUnusedImports removeUnusedImports) {
7676
addStepFactory(removeUnusedImports);
7777
}
7878

79-
public void addRemoveWildcardImports(ForbidWildcardImports forbidWildcardImports) {
79+
public void addForbidWildcardImports(ForbidWildcardImports forbidWildcardImports) {
8080
addStepFactory(forbidWildcardImports);
8181
}
8282

plugin-maven/src/test/java/com/diffplug/spotless/maven/java/LintSuppressionTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@ class LintSuppressionTest extends MavenIntegrationHarness {
2727

2828
@Test
2929
void testNoSuppressionFailsOnWildcardImports() throws Exception {
30-
writePomWithJavaSteps("<removeWildcardImports/>");
30+
writePomWithJavaSteps("<forbidWildcardImports/>");
3131

3232
String path = "src/main/java/TestFile.java";
3333
setFile(path).toResource("java/removewildcardimports/JavaCodeWildcardsUnformatted.test");
3434

3535
expectSelfieErrorMsg(mavenRunner().withArguments("spotless:check").runHasError()).toBe("""
3636
Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:VERSION:check (default-cli) on project spotless-maven-plugin-tests: Unable to format file ${PROJECT_DIR}/src/main/java/TestFile.java
37-
Step 'removeWildcardImports' found problem in 'TestFile.java':
38-
TestFile.java:L1 removeWildcardImports(import java.util.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
39-
TestFile.java:L2 removeWildcardImports(import static java.util.Collections.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
40-
TestFile.java:L5 removeWildcardImports(import io.quarkus.maven.dependency.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
41-
TestFile.java:L6 removeWildcardImports(import static io.quarkus.vertx.web.Route.HttpMethod.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
42-
TestFile.java:L7 removeWildcardImports(import static org.springframework.web.reactive.function.BodyInserters.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
37+
Step 'forbidWildcardImports' found problem in 'TestFile.java':
38+
TestFile.java:L1 forbidWildcardImports(import java.util.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
39+
TestFile.java:L2 forbidWildcardImports(import static java.util.Collections.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
40+
TestFile.java:L5 forbidWildcardImports(import io.quarkus.maven.dependency.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
41+
TestFile.java:L6 forbidWildcardImports(import static io.quarkus.vertx.web.Route.HttpMethod.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
42+
TestFile.java:L7 forbidWildcardImports(import static org.springframework.web.reactive.function.BodyInserters.*;) Do not use wildcard imports (e.g. java.util.*) - replace with specific class imports (e.g. java.util.List) as 'spotlessApply' cannot auto-fix this
4343
""");
4444
}
4545

4646
@Test
4747
void testSuppressByFilePath() throws Exception {
4848
writePomWithLintSuppressions(
49-
"<removeWildcardImports/>",
49+
"<forbidWildcardImports/>",
5050
"<lintSuppressions>",
5151
" <lintSuppression>",
5252
" <path>src/main/java/TestFile1.java</path>",
@@ -69,11 +69,11 @@ void testSuppressByFilePath() throws Exception {
6969
@Test
7070
void testSuppressByStep() throws Exception {
7171
writePomWithLintSuppressions(
72-
"<removeWildcardImports/>",
72+
"<forbidWildcardImports/>",
7373
"<lintSuppressions>",
7474
" <lintSuppression>",
7575
" <path>*</path>",
76-
" <step>removeWildcardImports</step>",
76+
" <step>forbidWildcardImports</step>",
7777
" <shortCode>*</shortCode>",
7878
" </lintSuppression>",
7979
"</lintSuppressions>");
@@ -89,7 +89,7 @@ void testSuppressByStep() throws Exception {
8989
void testSuppressByShortCode() throws Exception {
9090
// Use wildcard to suppress all shortCodes - this tests the shortCode suppression mechanism
9191
writePomWithLintSuppressions(
92-
"<removeWildcardImports/>",
92+
"<forbidWildcardImports/>",
9393
"<lintSuppressions>",
9494
" <lintSuppression>",
9595
" <path>*</path>",
@@ -108,7 +108,7 @@ void testSuppressByShortCode() throws Exception {
108108
@Test
109109
void testMultipleSuppressionsWork() throws Exception {
110110
writePomWithLintSuppressions(
111-
"<removeWildcardImports/>",
111+
"<forbidWildcardImports/>",
112112
"<lintSuppressions>",
113113
" <lintSuppression>",
114114
" <path>src/main/java/TestFile1.java</path>",

0 commit comments

Comments
 (0)