From 900133f1b303df1148c84a9c49debd3b28e60785 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 2 Feb 2016 18:49:31 -0500 Subject: [PATCH] Suppress checkstyle on generated files in painless Closes #16387 --- .../gradle/precommit/PrecommitTasks.groovy | 3 +++ buildSrc/src/main/resources/checkstyle.xml | 4 ++++ .../src/main/resources/checkstyle_suppressions.xml | 10 ++++++++++ 3 files changed, 17 insertions(+) create mode 100644 buildSrc/src/main/resources/checkstyle_suppressions.xml diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy index d4d4d08c393..1cdeec762d2 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/precommit/PrecommitTasks.groovy @@ -94,6 +94,9 @@ class PrecommitTasks { project.checkstyle { config = project.resources.text.fromFile( PrecommitTasks.getResource('/checkstyle.xml'), 'UTF-8') + configProperties = [ + suppressions: PrecommitTasks.getResource('/checkstyle_suppressions.xml') + ] } for (String taskName : ['checkstyleMain', 'checkstyleTest']) { Task task = project.tasks.findByName(taskName) diff --git a/buildSrc/src/main/resources/checkstyle.xml b/buildSrc/src/main/resources/checkstyle.xml index b44c649a52b..4dd0534fa01 100644 --- a/buildSrc/src/main/resources/checkstyle.xml +++ b/buildSrc/src/main/resources/checkstyle.xml @@ -6,6 +6,10 @@ + + + + + + +