-
Notifications
You must be signed in to change notification settings - Fork 486
RemoveWildCardImports Lint issue #2571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
iddeepak
wants to merge
17
commits into
diffplug:main
Choose a base branch
from
iddeepak:fix-RemoveWildcardImportsStep
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a93a424
removeWildcardImports: throw new AssertionError instead of removing
b846b0b
removeWildcardImports: throw new AssertionError instead of removing
730f211
Update lib/src/main/java/com/diffplug/spotless/java/RemoveWildcardImp…
Pankraz76 43adf9e
Merge remote-tracking branch 'f/fix-RemoveWildcardImportsStep' into f…
777f496
removeWildcardImports: throw new AssertionError instead of removing
0956a48
removeWildcardImports: throw new AssertionError instead of removing
350b8a4
wip
e13b9b0
Fix lint
iddeepak 1cb31dd
spotless-apply
iddeepak 0f95d2f
lib-spotless-apply
iddeepak 362502a
use lint-errors
iddeepak c4f0150
Merge branch 'diffplug:main' into fix-RemoveWildcardImportsStep
iddeepak 04e40ff
no lint-errors for maven spotless-apply
iddeepak c0cf2da
undo changes
iddeepak b331249
Merge branch 'diffplug:main' into fix-RemoveWildcardImportsStep
iddeepak 9042049
undo changes
iddeepak 8999fb2
undo changes
iddeepak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ | |
import com.diffplug.spotless.ResourceHarness; | ||
|
||
public class MavenIntegrationHarness extends ResourceHarness { | ||
|
||
protected static final String PATH = "src/main/java/test.java"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undo by inline. Thanks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks |
||
/** | ||
* To run tests in the IDE, run {@code gradlew :plugin-maven:changelogPrint}, then | ||
* put the last version it prints into {@code SPOTLESS_MAVEN_VERSION_IDE}. From now | ||
|
4 changes: 4 additions & 0 deletions
4
testlib/src/main/resources/java/removewildcardimports/JavaCodeNoWildcardsFormatted.test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import java.util.List; | ||
import mylib.Helper; | ||
|
||
public class Test {} |
4 changes: 4 additions & 0 deletions
4
testlib/src/main/resources/java/removewildcardimports/JavaCodeNoWildcardsUnformatted.test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import java.util.List; | ||
import mylib.Helper; | ||
|
||
public class Test {} |
5 changes: 5 additions & 0 deletions
5
testlib/src/main/resources/java/removewildcardimports/JavaCodeWildcardsFormatted.test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
import java.util.*; | ||
import static java.util.Collections.*; | ||
import java.util.List; | ||
import mylib.Helper; | ||
import io.quarkus.maven.dependency.*; | ||
import static io.quarkus.vertx.web.Route.HttpMethod.*; | ||
import static org.springframework.web.reactive.function.BodyInserters.*; | ||
|
||
public class Test {} |
42 changes: 42 additions & 0 deletions
42
testlib/src/test/java/com/diffplug/spotless/generic/ReplaceRegexStepTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2025 DiffPlug | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.diffplug.spotless.generic; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import com.diffplug.common.base.StringPrinter; | ||
import com.diffplug.spotless.FormatterStep; | ||
import com.diffplug.spotless.StepHarness; | ||
|
||
class ReplaceRegexStepTest { | ||
@Test | ||
void formatter() throws Exception { | ||
FormatterStep step = ReplaceRegexStep.create("replace", "bad", "good"); | ||
StepHarness.forStep(step) | ||
.test("bad bad", "good good"); | ||
} | ||
|
||
@Test | ||
void lint() throws Exception { | ||
FormatterStep step = ReplaceRegexStep.lint("regex", "bad", "no bad words"); | ||
StepHarness.forStep(step) | ||
.expectLintsOf(StringPrinter.buildStringFromLines( | ||
"bad", | ||
"x bad y", | ||
"ok")) | ||
.toBe("L1 regex(bad) no bad words\nL2 regex(bad) no bad words"); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nedtwigg
spotless:apply for maven does not show lint errors ? for gradle it does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha! you are correct! i will try to fix that problem this week...
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it resolved so we can continue, or is the issue bigger than expected?