SonarCloud doesn’t report unused imports for lombok-related imports.
The obvious reason is that https://jira.sonarsource.com/browse/SONARJAVA-3154 implementation was too wide and completely ignores all Lombok-related imports.
It’s pretty annoying because more often than not the unused lombok imports should be reported as issues.
Example of a class that should report 3 issues but it doesn’t
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
public class LombokClass {
private int x;
}
The original problem of SONARJAVA-3154 should be fixed more specifically, by filtering out lombok.var etc…