Skip to content
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

Add Spotless to build #1926

Merged
merged 1 commit into from
Apr 1, 2023
Merged

Add Spotless to build #1926

merged 1 commit into from
Apr 1, 2023

Conversation

basil
Copy link
Member

@basil basil commented Apr 1, 2023

My first line of defense when working on Groovy code is Spotless: if Spotless can't format it, then Groovy certainly won't be able to interpret it. "Testing" Groovy code with Spotless saves me time. So I am introducing Spotless in this repository. This PR applies Spotless to all pom.xml, Java, and Groovy files in this repository. I recommend reviewing this with the Hide Whitespace changes feature enabled.

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Member Author

Choose a reason for hiding this comment

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

Conflicts with the changes that would be made by updatecli/generate-manifests.ps1, but that script has been disabled for quite some time and is effectively dead code that the maintainers ought to remove from this repository.

@@ -33,7 +34,6 @@ if (settings.activeProfiles.any {it ==~ /^2[.][0-9]+[.]x$/}) {

expected: $sortedDeps
""")
// TODO also check sorting of sample plugin dependencies
Copy link
Member Author

Choose a reason for hiding this comment

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

Finally implementing this long-standing TODO.

<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<configuration>
Copy link
Member Author

Choose a reason for hiding this comment

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

The configuration has to be duplicated here unfortunately because sample-plugin extends from the plugin POM and not the root of the multi-module project. This is basically a hack as explained in #683.

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Thanks very much. I was missing this to maintain the sorted order of entries in the pom files.

@MarkEWaite MarkEWaite enabled auto-merge (squash) April 1, 2023 01:43
@MarkEWaite MarkEWaite disabled auto-merge April 1, 2023 02:42
@MarkEWaite MarkEWaite merged commit b3bf7f9 into jenkinsci:master Apr 1, 2023
@basil basil deleted the spotless branch April 1, 2023 02:58
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.

2 participants