apache / celeborn

Apache Celeborn is an elastic and high-performance service for shuffle and spilled data.
https://celeborn.apache.org/
Apache License 2.0
862 stars 351 forks source link

[CELEBORN-1565] Introduce warn-unused-import in Scala #2689

Closed cxzl25 closed 2 weeks ago

cxzl25 commented 4 weeks ago

What changes were proposed in this pull request?

This PR aims to introduce warn-unused-import in Scala.

Why are the changes needed?

There are currently many invalid imports, which can be checked using -Ywarn-unused-import. And through silencer plugin we can avoid some imports required in scala 2.11.

import org.apache.celeborn.common.util.FunctionConverter._

Does this PR introduce any user-facing change?

No

How was this patch tested?

GA

FMX commented 4 weeks ago

Finally, there is a PR to fix this problem. BTW Are there any tools to find unused methods?

codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 33.24%. Comparing base (ea6617c) to head (d5686f8). Report is 52 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2689 +/- ## ========================================== - Coverage 39.83% 33.24% -6.59% ========================================== Files 239 313 +74 Lines 15026 18275 +3249 Branches 1362 1678 +316 ========================================== + Hits 5984 6073 +89 - Misses 8711 11863 +3152 - Partials 331 339 +8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cxzl25 commented 4 weeks ago

Are there any tools to find unused methods

Maybe scalafix.

https://scalacenter.github.io/scalafix/docs/rules/RemoveUnused.html

FMX commented 3 weeks ago

Please fix the conflicts. This PR looks good to me.

FMX commented 3 weeks ago

Are there any tools to find unused methods

Maybe scalafix.

https://scalacenter.github.io/scalafix/docs/rules/RemoveUnused.html

Is there any relative tools for Java?

FMX commented 3 weeks ago

Are there any tools to find unused methods

Maybe scalafix.

https://scalacenter.github.io/scalafix/docs/rules/RemoveUnused.html

Are there any relative tools for Java?

FMX commented 3 weeks ago

Are there any tools to find unused methods

Maybe scalafix.

https://scalacenter.github.io/scalafix/docs/rules/RemoveUnused.html

Are there any relative tools for Java?

mridulm commented 3 weeks ago

Isnt there not a checkstyle rule for this ?

mridulm commented 3 weeks ago

And I just realized we dont have checkstyle for Celeborn :-) Perhaps that might help with this as well as other style enforcements ?

cxzl25 commented 3 weeks ago

we dont have checkstyle for Celeborn

Because we use spotless-maven-plugin, there may be some check conflicts with checkstyle. In addition, .scalafmt.conf is used in scala to check some formats.

cxzl25 commented 2 weeks ago

Thanks. Merged into main(v0.6.0).