apache / orc

Apache ORC - the smallest, fastest columnar storage for Hadoop workloads
https://orc.apache.org/
Apache License 2.0
670 stars 477 forks source link

ORC-1664: Migrate to `removeUnusedImports` of `spotless-maven-plugin` #1859

Closed cxzl25 closed 3 months ago

cxzl25 commented 3 months ago

What changes were proposed in this pull request?

This PR aims to enable the removeUnusedImports function in spotless-maven-plugin.

Now we can use the following command to automatically remove unused imports.

mvn spotless:apply -Panalyze

Why are the changes needed?

We now checkstyle configured <module name="UnusedImports"/>, but it will only check and will not automatically fix the problem.

spotless-maven-plugin provides a useful function to automatically remove unused imports, which can provide the efficiency of java developers.

How was this patch tested?

local test

Was this patch authored or co-authored using generative AI tooling?

No

cxzl25 commented 3 months ago

please remove the following

done

In addition, can we migrate more rules from checkstyle to spotless?

This is a good idea, I can continue to try it in the new JIRA.