If you are looking for a solution that provides the above functionality, as well as an error report in html format and puts the entire checkstyle configuration in gradle, look at gradle-estilo-plugin .
On the side, no, I have to point out that I myself wrote this plugin, and I widely use it in all my projects.
source share