Yeah, I ran into this issue when started using SonarQube
There are two xml rules, one for formatter and one for source clean-up. You can import at Eclipse and IntelliJ IDEA (using a plugin)
It worked for me, as it reduced my issues at this 70k LOC project :
+-----------------+--------+-------+ | | Before | After | +-----------------+--------+-------+ | Issues | 4.306 | 2.977 | | Blocker issues | 0 | 0 | | Critical issues | 257 | 257 | | Major issues | 2.402 | 1.994 | | Minor issues | 1.642 | 721 | | Info issues | 5 | 5 | +-----------------+--------+-------+
Here are the formatter.xml and cleanup.xml rules. Credit goes to this github repo and it's authors.
Blog post automating such task on Eclipse here. It states a important caveat
Not everything can be automated
Please note that although a lot of coding standards can be applied retroactively and automatically, some violations cannot be automatically eradicated. Nonetheless, Checkstyle, Eclipse and Sonar can identify the problematic code and guide developers towards coding standard compliance.
Yes, I'm aware you're using only Checkstyle, but I'm sure it applies, since SonarQube uses Checkstyle to raise it's issues.