Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public void apply(Project project) {

java.target("src/**/*.java");
java.removeUnusedImports();
java.removeWildcardImports();
Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

please merge

As I have to recreate it, as already mentioned. The code need to be complain to use this feature.

@DaveCTurner or do you want an even bigger PR, as rewrite its not doing it at once i have to run it multiple times.

Copy link
Author

Choose a reason for hiding this comment

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

Assuming most changes are not covered by Spotless, as there are some blind spots—as its the case with every tool, including Rewrite.

It seems I cannot recreate the changes you're requesting, as they aren't achievable through a simple Spotless configuration change.

Since removing unused imports isn't a new task, would it be acceptable to add a plugin specifically for this purpose? This approach would allow for future enhancements, when there is the demand or not.

As there are a log best practises this project could benefit from including:


// We enforce a standard order for imports
java.importOrderFile(new File(elasticsearchWorkspace, importOrderPath));
Expand Down
2 changes: 1 addition & 1 deletion gradle/build.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ snakeyaml = { group = "org.yaml", name = "snakeyaml", version = { strictly = "2.
spock-core = { group = "org.spockframework", name="spock-core", version.ref="spock" }
spock-junit4 = { group = "org.spockframework", name="spock-junit4", version.ref="spock" }
spock-platform = { group = "org.spockframework", name="spock-bom", version.ref="spock" }
spotless-plugin = "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
spotless-plugin = "com.diffplug.spotless:spotless-plugin-gradle:7.2.1"
wiremock = "com.github.tomakehurst:wiremock-jre8-standalone:2.23.2"
xmlunit-core = "org.xmlunit:xmlunit-core:2.8.2"

Expand Down
32 changes: 31 additions & 1 deletion gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<trust group="beats" name="metricbeat"/>
<trust group="beats" name="metricbeat-fips"/>
<trust group="elasticsearch-distribution" name="elasticsearch"/>
<trust group="openjdk_.*" regex="true"/>
<trust group="org.elasticsearch"/>
<trust group="org.elasticsearch.distribution.zip" name="elasticsearch"/>
<trust group="org.elasticsearch.ml"/>
<trust group="org.elasticsearch.plugin"/>
<trust file=".*-javadoc[.]jar" regex="true"/>
<trust file=".*-sources[.]jar" regex="true"/>
<trust group="openjdk_.*" regex="true"/>
</trusted-artifacts>
</configuration>
<components>
Expand Down Expand Up @@ -252,6 +252,11 @@
<sha256 value="caa88246e4f3b4d26e4c4b24b31db33a6758747429f6429702ab8dd75bd58e90" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.diffplug.spotless" name="spotless-lib" version="3.3.1">
<artifact name="spotless-lib-3.3.1.jar">
<sha256 value="7c74aa3d85e5f0563f06af05808cef62af8e378786f27dca40cfe817f402267b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.diffplug.spotless" name="spotless-lib-extra" version="2.45.0">
<artifact name="spotless-lib-extra-2.45.0.jar">
<sha256 value="602cbbcd3828ee9cfb2e30a7f9b30335c6927130771414d4cdd294d21fe5cb67" origin="Generated by Gradle"/>
Expand All @@ -262,6 +267,11 @@
<sha256 value="58e3ddd55199ad74c28fa6490bad1e2b707d7aa4694d3611af2394af77fa2212" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.diffplug.spotless" name="spotless-lib-extra" version="3.3.1">
<artifact name="spotless-lib-extra-3.3.1.jar">
<sha256 value="64c1219236fe562bdaa9aa3ba89531c3fab81ea232a4fffd46444df6399bf95a" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.diffplug.spotless" name="spotless-plugin-gradle" version="6.25.0">
<artifact name="spotless-plugin-gradle-6.25.0.jar">
<sha256 value="f5eb908a4c5da46299e7543faada0402d2c4b77d58c7b432d4b6e59349b280a3" origin="Generated by Gradle"/>
Expand All @@ -272,6 +282,11 @@
<sha256 value="a3609eeb7173837a589a4ad865e6feaf71ee6139d061eae2e698401485f7589c" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.diffplug.spotless" name="spotless-plugin-gradle" version="7.2.1">
<artifact name="spotless-plugin-gradle-7.2.1.jar">
<sha256 value="ff5bd9bde1f21b486d0f87a96a2e90fad1d88971a04bef6941d94caa52e27afd" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.ethlo.time" name="itu" version="1.7.0">
<artifact name="itu-1.7.0.jar">
<sha256 value="55ceb418c9e8138c4fcf62e213c4c814d89e8a84c827d395407cbecba5d791e7" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -1534,6 +1549,11 @@
<sha256 value="cc272e742da41a326623a83ec1b086832fe80869cbf0a19627887f1fb128312c" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="dev.equo.ide" name="solstice" version="1.8.1">
<artifact name="solstice-1.8.1.jar">
<sha256 value="6e5ba2cce813be1d71ccdc2ecf3e49271b14e691bfbbb1a114cf3a30e773b10d" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="dnsjava" name="dnsjava" version="2.1.7">
<artifact name="dnsjava-2.1.7.jar">
<sha256 value="2c52a6fabd5af9331d73fc7787dafc32a56bd8019c49f89749c2eeef244e303c" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -3937,6 +3957,11 @@
<sha256 value="43f92f3adb681a5f3006b979e8d341c12a8cfd8029f287c42bcf0a80377565ae" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit" version="6.10.1.202505221210-r">
<artifact name="org.eclipse.jgit-6.10.1.202505221210-r.jar">
<sha256 value="8f0135ca45d00c4da8e7ba2e96d44e1ade452bf279d79ca4eb54921e8f27952c" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.jgit" name="org.eclipse.jgit" version="6.5.0.202303070854-r">
<artifact name="org.eclipse.jgit-6.5.0.202303070854-r.jar">
<sha256 value="9b4da8cde1651fa7a9f4d242585fe94343d40165e4c06ad5a722044a2cbe6251" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -4092,6 +4117,11 @@
<sha256 value="11e61736689f0c1af46c9a852420058e10c6072f936c8308b6eca50e46dd38ef" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.platform" name="org.eclipse.osgi" version="3.23.100">
<artifact name="org.eclipse.osgi-3.23.100.jar">
<sha256 value="9164f40fd0b424caf21ca6518186d2af82691f2a8de452f8a7d290b955280a21" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.eclipse.platform" name="org.eclipse.text" version="3.13.100">
<artifact name="org.eclipse.text-3.13.100.jar">
<sha256 value="89afa204e8e686eaa5f1464a6ceb65ac1b341ad1d0326cab6716c6733ecaf5ac" origin="Generated by Gradle"/>
Expand Down