Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ spotless {
### expandWildcardImports

This step expands all wildcard imports to single class imports.
To do this, [JavaParser](https://javaparser.org/) is used to parse the complete sourcecode and resolve the full qualified name of all used classes and static methods.
To do this, [JavaParser](https://javaparser.org/) is used to parse the complete sourcecode and resolve the full qualified name of all used classes and static methods from the full classpath.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Have extended this to also mention the classpath, because it seems fetching that (and processing it?) might also be expensive, see #2983.

But if you want I can omit this again.

This operation can be resource intensive when formatting many source files, so you may want to change to `forbidWildcardImports` when your codebase is cleaned and stable.

```
Expand Down
12 changes: 11 additions & 1 deletion plugin-maven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ any other maven phase (i.e. compile) then it can be configured as below;
</importOrder>

<removeUnusedImports /> <!-- self-explanatory -->
<forbidWildcardImports /> <!-- yell if any import ends with '*' -->
<forbidWildcardImports /> <!-- yell if any import ends with '*'; or use expandWildcardImports, see below -->
<forbidModuleImports /> <!-- yell if any module imports are found (Java 25+) -->

<formatAnnotations /> <!-- fixes formatting of type annotations, see below -->
Expand All @@ -260,6 +260,16 @@ any other maven phase (i.e. compile) then it can be configured as below;
<forbidWildcardImports/>
```

### expandWildcardImports

This step expands all wildcard imports to single class imports.
To do this, [JavaParser](https://javaparser.org/) is used to parse the complete sourcecode and resolve the full qualified name of all used classes and static methods from the full classpath.
This operation can be resource intensive when formatting many source files, so you may want to change to `forbidWildcardImports` when your codebase is cleaned and stable.

```xml
<expandWildcardImports/>
```

### forbidModuleImports

```xml
Expand Down
Loading