Skip to content

Build: Integrate Scalafix to auto-fix unused Scala imports#15676

Open
jackylee-ch wants to merge 1 commit intoapache:mainfrom
jackylee-ch:apply_scalafix_to_autofix_unused_imports
Open

Build: Integrate Scalafix to auto-fix unused Scala imports#15676
jackylee-ch wants to merge 1 commit intoapache:mainfrom
jackylee-ch:apply_scalafix_to_autofix_unused_imports

Conversation

@jackylee-ch
Copy link
Contributor

Integrate Scalafix with the RemoveUnused rule to automatically fix unused Scala imports via ./gradlew scalafix.
Fix #14342

@jackylee-ch jackylee-ch force-pushed the apply_scalafix_to_autofix_unused_imports branch from beaf75d to b007c87 Compare March 19, 2026 01:24
For Scala code, unused imports are treated as compilation errors. To automatically remove unused imports, run [Scalafix](https://scalacenter.github.io/scalafix/):

```bash
./gradlew scalafix -DsparkVersions=4.0 -DscalaVersion=2.13
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this also work with Spark 3.5 scala 2.12?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it works.

@huaxingao
Copy link
Contributor

LGTM from my side. Any other reviewers interested in taking a look? Maybe @RussellSpitzer ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unused imports check/fix for Scala Code

2 participants