Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

removeUnusedImports does nothing

Open
#2,582 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java

Research direction

Start with the linked demo project's build.gradle.kts configuration and reproduce the behavior using the Gradle wrapper, Spotless 7.2.1, and the default palantirJavaFormat. Compare spotlessApply results and --info output against the configured removeUnusedImports step. Done means the unused imports in the generated OpenAPI stubs are removed without errors.

Written by the indexing model from the issue text.

Description

bug-unconfirmed

I have a demo project that I've recently started. I generated some stubs from the OpenAPI spec using the Gradle plugin for that, and the code had some unused imports. I have configured Spotless to remove unused imports here, but it's not happening. I don't see any errors when I run spotlessApply, and if I add the --info flag I don't see any mention of import in the output.

Project details:
Gradle wrapper 8.14
Spotless plugin version 7.2.1
Default version of palantirJavaFormat

Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 13h
Merged PRs (30d)
43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.