File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ spotless {
207207
208208 removeUnusedImports()
209209 forbidWildcardImports()
210+ forbidModuleImports()
210211
211212 // Cleanthat will refactor your code, but it may break your style: apply it before your formatter
212213 cleanthat() // has its own section below
@@ -257,6 +258,16 @@ spotless {
257258}
258259```
259260
261+ ### forbidModuleImports
262+
263+ ```
264+ spotless {
265+ java {
266+ forbidModuleImports()
267+ }
268+ }
269+ ```
270+
260271### google-java-format
261272
262273[homepage](https://github.com/google/google-java-format). [changelog](https://github.com/google/google-java-format/releases).
Original file line number Diff line number Diff line change @@ -231,6 +231,7 @@ any other maven phase (i.e. compile) then it can be configured as below;
231231
232232 <removeUnusedImports /> <!-- self-explanatory -->
233233 <forbidWildcardImports /> <!-- yell if any import ends with '*' -->
234+ <forbidModuleImports /> <!-- yell if any module imports are found (Java 25+) -->
234235
235236 <formatAnnotations /> <!-- fixes formatting of type annotations, see below -->
236237
@@ -255,6 +256,12 @@ any other maven phase (i.e. compile) then it can be configured as below;
255256<forbidWildcardImports />
256257```
257258
259+ ### forbidModuleImports
260+
261+ ``` xml
262+ <forbidModuleImports />
263+ ```
264+
258265### google-java-format
259266
260267[ homepage] ( https://github.com/google/google-java-format ) . [ changelog] ( https://github.com/google/google-java-format/releases ) . [ code] ( https://github.com/diffplug/spotless/blob/main/plugin-maven/src/main/java/com/diffplug/spotless/maven/java/GoogleJavaFormat.java ) .
You can’t perform that action at this time.
0 commit comments