Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
base: main
Choose a base branch
Loading
from iddeepak:fix-RemoveWildcardImportsStep

Conversation

Copy link
Contributor

@iddeepak iddeepak commented Jul 22, 2025

Thank you @Pankraz76. please feel free to use these changes
Original PR: #2557

Copy link
Contributor

nice one, thank you so much.

iddeepak reacted with heart emoji

Copy link
Contributor Author

Most of the work is already done by @Pankraz76. I updated Lint changes on top of it. kindly request your feedback.
@owaiskazi19
@sbrannen
@nedtwigg

@iddeepak iddeepak marked this pull request as ready for review July 22, 2025 18:12
Copy link
Member

This is close! It needs

  • ReplaceRegexStepTest which should be next to this
  • right now it can only catch the first problem. but it would be easy to catch all of them
    • in the format function, just return the input unchanged, don't throw
    • in the lint function, return multiple lints
    • public interface FormatterFunc {
      String apply(String input) throws Exception;
      default String apply(String unix, File file) throws Exception {
      return apply(unix);
      }
      /**
      * Calculates a list of lints against the given content.
      * By default, that's just an throwables thrown by the lint.
      */
      default List<Lint> lint(String content, File file) throws Exception {
      return List.of();
      }
    • the exception thing is a hack for a formatter which is primarily about formatting. if you are primarily about linting, better to use the other method
iddeepak reacted with thumbs up emoji

int line = 1 + (int) raw.codePoints().limit(matcher.start()).filter(c -> c == '\n').count();
lints.add(atLine(line, matcher.group(0), replacement));
}
return lints;
Copy link
Contributor Author

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.

Copy link
Member

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...

Copy link
Contributor

@Pankraz76 Pankraz76 Aug 6, 2025
edited
Loading

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?

@@ -46,6 +46,8 @@
import com.diffplug.spotless.ResourceHarness;

public class MavenIntegrationHarness extends ResourceHarness {

protected static final String PATH = "src/main/java/test.java";
Copy link
Contributor

@Pankraz76 Pankraz76 Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo by inline. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Copy link
Contributor Author

#2455
In maven-plugin too

Pankraz76 reacted with thumbs up emoji

Copy link
Contributor

please let fix this first and have this as second version.

Just fail the build with an bread error like done in open search. The detailed line number can follow afterwards not to block this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@nedtwigg nedtwigg nedtwigg left review comments

+1 more reviewer

@Pankraz76 Pankraz76 Pankraz76 left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /