Skip to content

Conversation

@Plunts
Copy link
Contributor

@Plunts Plunts commented Nov 20, 2025

As requested in #2594, this MR introduces an expandWildcardImports step. To do this, JavaParser is used to parse the complete sourcecode and resolve the full qualified name of all used classes and static methods.

The operation is currently only implemented for Gradle, as I am not familiar enough with the maven plugin system to provide the necessary classpath information.

@nedtwigg nedtwigg force-pushed the expandWildcardImports branch from db71c5d to 1a293cb Compare November 20, 2025 18:29
@nedtwigg
Copy link
Member

Amazing! This would be a fantastic feature to merge. I don't have time to examine it in detail at the moment, burned by time budget on fixing problems in our CI. Thanks for the great contribution and I'll try to get to this ASAP! Hopefully some other reviewers can take a stab at it...

Copy link
Contributor

@Pankraz76 Pankraz76 left a comment

Choose a reason for hiding this comment

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

great feature, thanks.

```
spotless {
java {
expandWildcardImports()
Copy link
Contributor

Choose a reason for hiding this comment

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

@Pankraz76
Copy link
Contributor

rebase will fix CI, thanks for the feature.

Sorry for noisy delay.

Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Copy link
Contributor

@Pankraz76 Pankraz76 left a comment

Choose a reason for hiding this comment

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

well done seems ready to merge.

polish and might deprecating removeWildcard could be follow up issues.

Appreciate the initiative and contribution.

* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.diffplug.spotless.glue.javaparser;
Copy link
Contributor

Choose a reason for hiding this comment

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

package does not reflect folder name. idk whats the ideal for this.

Suggested change
package com.diffplug.spotless.glue.javaparser;
package com.diffplug.spotless.glue.javaParser;

Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Pankraz76 pushed a commit to Pankraz76/spotless that referenced this pull request Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants