Skip to content

Commit c00d897

Browse files
committed
fix: spotless plugin (googleJavaFormat)
Signed-off-by: xstefank <[email protected]>
1 parent b2106f0 commit c00d897

File tree

7 files changed

+56
-402
lines changed

7 files changed

+56
-402
lines changed

Diff for: .vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"java.format.settings.url": "contributing/eclipse-google-style.xml",
2+
"java.format.settings.url": "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml",
33
"java.completion.importOrder": [
44
"java",
55
"javax",

Diff for: CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ The SDK modules and samples are formatted to follow the Java Google code style.
6262
On every `compile` the code gets formatted automatically,
6363
however, to make things simpler (i.e. avoid getting a PR rejected simply because of code style issues), you can import one of the following code style schemes based on the IDE you use:
6464

65-
- for *IntelliJ IDEA*:
66-
- Install the [Eclipse Code Formatter plugin](https://github.com/krasa/EclipseCodeFormatter#instructions)
67-
- Use [contributing/eclipse-google-style.xml](contributing/eclipse-google-style.xml) for the Eclipse formatter config file
68-
- for *Eclipse* import [contributing/eclipse-google-style.xml](contributing/eclipse-google-style.xml)
65+
- for *Intellij IDEA*
66+
install [google-java-format](https://plugins.jetbrains.com/plugin/8527-google-java-format) plugin
67+
- for *Eclipse*
68+
follow [these intructions](https://github.com/google/google-java-format?tab=readme-ov-file#eclipse)
6969

7070
## Thanks
7171

Diff for: contributing/eclipse-google-style.xml

-337
This file was deleted.

Diff for: contributing/eclipse.importorder

-7
This file was deleted.

Diff for: docs/content/en/docs/contributing/_index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ avoid getting a PR rejected simply because of code style issues), you can import
7272
following code style schemes based on the IDE you use:
7373

7474
- for *Intellij IDEA*
75-
import [contributing/intellij-google-style.xml](contributing/intellij-google-style.xml)
75+
install [google-java-format](https://plugins.jetbrains.com/plugin/8527-google-java-format) plugin
7676
- for *Eclipse*
77-
import [contributing/eclipse-google-style.xml](contributing/eclipse-google-style.xml)
77+
follow [these intructions](https://github.com/google/google-java-format?tab=readme-ov-file#eclipse)
7878

7979
## Thanks
8080

Diff for: operator-framework-bom/pom.xml

+16-7
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,34 @@
7878
<plugin>
7979
<groupId>com.diffplug.spotless</groupId>
8080
<artifactId>spotless-maven-plugin</artifactId>
81-
<version>${spotless.version}</version>
8281
<configuration>
8382
<pom>
8483
<includes>
8584
<include>pom.xml</include>
8685
<include>./**/pom.xml</include>
8786
</includes>
88-
<sortPom></sortPom>
87+
<sortPom>
88+
<expandEmptyElements>false</expandEmptyElements>
89+
</sortPom>
8990
</pom>
9091
<java>
91-
<eclipse>
92-
<file>contributing/eclipse-google-style.xml</file>
93-
</eclipse>
92+
<googleJavaFormat>
93+
<reflowLongStrings>true</reflowLongStrings>
94+
</googleJavaFormat>
9495
<importOrder>
95-
<file>contributing/eclipse.importorder</file>
96+
<order>java,javax,org,io,com,,\#</order>
9697
</importOrder>
97-
<removeUnusedImports></removeUnusedImports>
98+
<removeUnusedImports/>
9899
</java>
99100
</configuration>
101+
<executions>
102+
<execution>
103+
<goals>
104+
<goal>apply</goal>
105+
</goals>
106+
<phase>compile</phase>
107+
</execution>
108+
</executions>
100109
</plugin>
101110
</plugins>
102111
</build>

Diff for: pom.xml

+33-44
Original file line numberDiff line numberDiff line change
@@ -327,53 +327,42 @@
327327
<excludedGroups>WatchPermissionAwareTest</excludedGroups>
328328
</configuration>
329329
</plugin>
330+
<plugin>
331+
<groupId>com.diffplug.spotless</groupId>
332+
<artifactId>spotless-maven-plugin</artifactId>
333+
<configuration>
334+
<pom>
335+
<includes>
336+
<include>pom.xml</include>
337+
<include>./**/pom.xml</include>
338+
</includes>
339+
<sortPom>
340+
<expandEmptyElements>false</expandEmptyElements>
341+
</sortPom>
342+
</pom>
343+
<java>
344+
<googleJavaFormat>
345+
<reflowLongStrings>true</reflowLongStrings>
346+
</googleJavaFormat>
347+
<importOrder>
348+
<order>java,javax,org,io,com,,\#</order>
349+
</importOrder>
350+
<removeUnusedImports/>
351+
</java>
352+
</configuration>
353+
<executions>
354+
<execution>
355+
<goals>
356+
<goal>apply</goal>
357+
</goals>
358+
<phase>compile</phase>
359+
</execution>
360+
</executions>
361+
</plugin>
362+
330363
</plugins>
331364
</build>
332365
<profiles>
333-
<profile>
334-
<id>spotless</id>
335-
<activation>
336-
<file>
337-
<exists>contributing</exists>
338-
</file>
339-
</activation>
340-
<build>
341-
<plugins>
342-
<plugin>
343-
<groupId>com.diffplug.spotless</groupId>
344-
<artifactId>spotless-maven-plugin</artifactId>
345-
<configuration>
346-
<pom>
347-
<includes>
348-
<include>pom.xml</include>
349-
<include>./**/pom.xml</include>
350-
</includes>
351-
<sortPom>
352-
<expandEmptyElements>false</expandEmptyElements>
353-
</sortPom>
354-
</pom>
355-
<java>
356-
<eclipse>
357-
<file>contributing/eclipse-google-style.xml</file>
358-
</eclipse>
359-
<importOrder>
360-
<file>contributing/eclipse.importorder</file>
361-
</importOrder>
362-
<removeUnusedImports/>
363-
</java>
364-
</configuration>
365-
<executions>
366-
<execution>
367-
<goals>
368-
<goal>apply</goal>
369-
</goals>
370-
<phase>compile</phase>
371-
</execution>
372-
</executions>
373-
</plugin>
374-
</plugins>
375-
</build>
376-
</profile>
377366
<profile>
378367
<id>integration-tests</id>
379368
<build>

0 commit comments

Comments
 (0)