ファイルの一部分をチェック対象外にする
Checkstyle - Filtersのsuppressを参照.
まず, checkstyleのconfigファイルに下記FileContentsHolderとSuppressionCommentFiltermoduleを設定. 
<module name="Checker">
  <module name="TreeWalker">
    ...
    <module name="FileContentsHolder"/>
  </module>
  <module name="SuppressionCommentFilter"/>
</module>これで// CHECKSTYLE:OFFのコメントから// CHECKSTYLE:ONのコメントまでの間を, Checkstyleのチェック対象外として指定できる. 
// CHECKSTYLE:OFF
for (int i = 0, len = array.length; i < len; i++) {
  ...
}
// CHECKSTYLE:ON警告抑止設定の外部ファイル化
checkstyleのconfigファイルに下記SuppressionFiltermoduleを設定. 
valueにsuppressions定義ファイルのパスを指定する. 
<module name="SuppressionFilter">
  <property name="file" value="./app/config/checkstyle/suppressions.xml"/>
</module>suppressions.xmlのexample. 
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
    "-//Puppy Crawl//DTD Suppressions 1.1//EN"
    "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
  <suppress checks="MethodName" files="Hoge.java" />
</suppressions>Checkstyleの解析結果をHTML形式で出力する
Generate Checkstyle HTML report with Gradleを参照.
Checkstyle pluginのreportsはhtml形式をサポートしていないのでxslを使ってstylesheetをあてる.
task checkstyle(type: Checkstyle) {
    configFile = file("$projectDir/config/checkstyle/checkstyle.xml")
    source 'src/main/java'
    include '**/*.java'
    exclude '**/gen/**'
    classpath = files()
    reports {
        xml {
            destination "$buildDir/reports/checkstyle/report.xml"
        }
    }
}
task checkstyleReport << {
    if (file("$buildDir/reports/checkstyle/report.xml").exists()) {
        ant.xslt(in: "$buildDir/reports/checkstyle/report.xml",
                style:"$projectDir/config/checkstyle/checkstyle.xsl",
                out:"$buildDir/reports/checkstyle/checkstyle.html"
        )
    }
}
gradle.taskGraph.afterTask {Task task, TaskState state ->
    if(state.failure) {
        if (task.name in ['checkstyle']) {
            checkstyleReport.execute()
        }
    }
}以上.