-
Notifications
You must be signed in to change notification settings - Fork 7
Add spotless plugin configuration #169
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
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6d4aa84
Add spotless plugin configuration
slachiewicz 4dad812
Merge remote-tracking branch 'origin/master' into spotless
gnodet b49a9f2
Update to latest plugin
gnodet 40f4fcd
Use two profiles for spotless
gnodet c5f201a
Fix format
gnodet f43acfc
Merge branch 'master' into spotless
gnodet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -332,9 +332,11 @@ limitations under the License. | |
<plexusDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/plexus-snapshots</plexusDistMgmtSnapshotsUrl> | ||
<project.build.outputTimestamp>2023-05-06T22:13:46Z</project.build.outputTimestamp> | ||
<gpg.useagent>true</gpg.useagent> | ||
<spotless-maven-plugin.version>2.36.0</spotless-maven-plugin.version> | ||
<mavenPluginToolsVersion>3.9.0</mavenPluginToolsVersion> | ||
<mavenFluidoSkinVersion>1.11.2</mavenFluidoSkinVersion> | ||
<junit5Version>5.9.3</junit5Version> | ||
<spotless.action>check</spotless.action> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
|
@@ -424,7 +426,8 @@ limitations under the License. | |
<configuration> | ||
<quiet>true</quiet> | ||
<locale>en</locale> | ||
<notimestamp>true</notimestamp><!-- avoid noise for svn/gitpubsub --> | ||
<!-- avoid noise for svn/gitpubsub --> | ||
<notimestamp>true</notimestamp> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
|
@@ -550,6 +553,41 @@ limitations under the License. | |
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>com.diffplug.spotless</groupId> | ||
<artifactId>spotless-maven-plugin</artifactId> | ||
<version>${spotless-maven-plugin.version}</version> | ||
<configuration> | ||
<java> | ||
<!-- orders of used formatters are important --> | ||
<!-- eg. palantir override importOrder, so should be first --> | ||
<palantirJavaFormat /> | ||
<removeUnusedImports /> | ||
<importOrder> | ||
<order>javax,java,,\#</order> | ||
</importOrder> | ||
</java> | ||
<pom> | ||
<sortPom> | ||
<expandEmptyElements>false</expandEmptyElements> | ||
<!-- https://issues.apache.org/jira/browse/MRELEASE-1111 --> | ||
<spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement> | ||
</sortPom> | ||
</pom> | ||
<upToDateChecking> | ||
<enabled>true</enabled> | ||
</upToDateChecking> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>spotless-check</id> | ||
<goals> | ||
<goal>${spotless.action}</goal> | ||
</goals> | ||
<phase>process-sources</phase> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
|
@@ -641,18 +679,6 @@ limitations under the License. | |
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-report-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-checkstyle-plugin</artifactId> | ||
<reportSets> | ||
<reportSet> | ||
<id>default</id> | ||
<reports> | ||
<report>checkstyle</report> | ||
</reports> | ||
</reportSet> | ||
</reportSets> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-pmd-plugin</artifactId> | ||
|
@@ -764,5 +790,57 @@ limitations under the License. | |
</plugins> | ||
</build> | ||
</profile> | ||
|
||
<profile> | ||
<id>java11+</id> | ||
<activation> | ||
<jdk>[11,)</jdk> | ||
</activation> | ||
|
||
<properties> | ||
<maven.compiler.release>${javaVersion}</maven.compiler.release> | ||
<!-- configuration for checkstyle to use with spotless --> | ||
<checkstyle.spotless.config>config/maven_checks_nocodestyle.xml</checkstyle.spotless.config> | ||
</properties> | ||
|
||
<build> | ||
<!--- newer versions of plugins requires JDK 11 --> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.diffplug.spotless</groupId> | ||
<artifactId>spotless-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-checkstyle-plugin</artifactId> | ||
<configuration> | ||
<configLocation>${checkstyle.spotless.config}</configLocation> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>format-check</id> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO additional profiles are not needed ... I simply execute |
||
<activation> | ||
<property> | ||
<name>!format</name> | ||
</property> | ||
</activation> | ||
<properties> | ||
<spotless.action>check</spotless.action> | ||
</properties> | ||
</profile> | ||
<profile> | ||
<id>format</id> | ||
<activation> | ||
<property> | ||
<name>format</name> | ||
</property> | ||
</activation> | ||
<properties> | ||
<spotless.action>apply</spotless.action> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
</project> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.