Skip to content

Commit

Permalink
Enable Spotless for .test-infra/jenkins/*.groovy files
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilwu committed Jul 22, 2020
1 parent 8ea176d commit 3cfb220
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .test-infra/jenkins/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id 'org.apache.beam.module'
}
applyGroovyNature()
1 change: 1 addition & 0 deletions .test-infra/jenkins/job_PreCommit_Spotless.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ PrecommitJobBuilder builder = new PrecommitJobBuilder(
'^runners/.*$',
'^examples/java/.*$',
'^examples/kotlin/.*$',
'^.test-infra/jenkins/.*$',
]
)
builder.build()
2 changes: 1 addition & 1 deletion buildSrc/greclipse.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=2
org.eclipse.jdt.core.formatter.indent_empty_lines=false
groovy.formatter.multiline.indentation=4
groovy.formatter.multiline.indentation=2
Original file line number Diff line number Diff line change
Expand Up @@ -1490,12 +1490,14 @@ class BeamModulePlugin implements Plugin<Project> {
project.apply plugin: "groovy"

project.apply plugin: "com.diffplug.gradle.spotless"
def disableSpotlessCheck = project.hasProperty('disableSpotlessCheck') &&
project.disableSpotlessCheck == 'true'
project.spotless {
enforceCheck !disableSpotlessCheck
def grEclipseConfig = project.project(":").file("buildSrc/greclipse.properties")
groovy {
licenseHeader javaLicenseHeader
paddedCell() // Recommended to avoid cyclic ambiguity issues
greclipse().configFile(grEclipseConfig)
target project.fileTree(project.projectDir) { include '**/*.groovy' }
}
groovyGradle { greclipse().configFile(grEclipseConfig) }
}
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,5 @@ include "beam-test-infra-metrics"
project(":beam-test-infra-metrics").dir = file(".test-infra/metrics")
include "beam-test-tools"
project(":beam-test-tools").dir = file(".test-infra/tools")
include "beam-test-jenkins"
project(":beam-test-jenkins").dir = file(".test-infra/jenkins")

0 comments on commit 3cfb220

Please sign in to comment.