Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e4cf50f

Browse files
authoredApr 12, 2023
Spotless yaml (GoogleCloudPlatform#227)
* Update spotless to v6.18.0 * Add spotless config to add license header to YAML * Cleanup: remove empty yaml file * Update license headers via spotlessApply
1 parent 7a8aedd commit e4cf50f

14 files changed

+73
-18
lines changed
 

‎build.gradle

+24
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,33 @@ plugins {
2020
id 'nebula.release'
2121
}
2222

23+
// Required with spotless v6+
24+
// See https://github.com/diffplug/spotless/issues/984 for details
25+
spotless {
26+
predeclareDepsFromBuildscript()
27+
}
28+
29+
// Need to predeclare every configuration used with spotless
30+
spotlessPredeclare {
31+
java {
32+
googleJavaFormat("1.9")
33+
}
34+
groovyGradle {
35+
greclipse()
36+
}
37+
}
38+
2339
// Format the root build too.
2440
spotless {
2541
groovyGradle {
2642
target '*.gradle' // default target of groovyGradle
2743
greclipse()
2844
licenseHeaderFile rootProject.file('buildscripts/spotless.license.gradle'), '(import|pluginManagement)'
2945
}
46+
yaml {
47+
target "*.yaml"
48+
licenseHeaderFile rootProject.file('buildscripts/spotless.license.yaml'), '([a-zA-Z]*:)'
49+
}
3050
}
3151

3252
// Configure release mechanism.
@@ -90,6 +110,10 @@ subprojects {
90110
greclipse()
91111
licenseHeaderFile rootProject.file('buildscripts/spotless.license.gradle'), '(import|plugins|description)'
92112
}
113+
yaml {
114+
target "*.yaml"
115+
licenseHeaderFile rootProject.file('buildscripts/spotless.license.yaml'), '([a-zA-Z]*:)'
116+
}
93117
}
94118

95119
// Make sure test failures include exception error messages for correction.

‎buildscripts/spotless.license.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

‎cloudbuild-e2e-cloud-functions-gen2.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Google
1+
# Copyright 2023 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
steps:
1615
# Generate shadowJar for the instrumented test server
1716
- name: "gradle:8.0.2-jdk11"

‎cloudbuild-e2e-cloud-run.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Google
1+
# Copyright 2023 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
steps:
1615
# Wait for the image to exist
1716
- name: "docker"

‎cloudbuild-e2e-gae.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Google
1+
# Copyright 2023 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
steps:
1615
# Wait for the image to exist
1716
- name: "docker"

‎cloudbuild-e2e-gce.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Google
1+
# Copyright 2023 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
steps:
1615
# Wait for the image to exist
1716
- name: "docker"

‎cloudbuild-e2e-gke.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Copyright 2021 Google
1+
# Copyright 2023 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
55
# You may obtain a copy of the License at
66
#
7-
# http://www.apache.org/licenses/LICENSE-2.0 #
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
89
# Unless required by applicable law or agreed to in writing, software
910
# distributed under the License is distributed on an "AS IS" BASIS,
1011
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1112
# See the License for the specific language governing permissions and
1213
# limitations under the License.
13-
1414
steps:
1515
# Wait for the image to exist
1616
- name: "docker"

‎cloudbuild-e2e-image.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Google
1+
# Copyright 2023 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
steps:
1615
# If the image doesn't exist, create a skip file for the next step to know
1716
- name: "gcr.io/cloud-builders/gcloud"

‎cloudbuild-e2e-local.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Google
1+
# Copyright 2023 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
steps:
1615
# Wait for the image to exist
1716
- name: "docker"

‎examples/autoconf/job.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
apiVersion: batch/v1
215
kind: Job
316
metadata:

‎examples/autoinstrument/deployment.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#
21
# Copyright 2023 Google LLC
32
#
43
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,7 +11,6 @@
1211
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1312
# See the License for the specific language governing permissions and
1413
# limitations under the License.
15-
#
1614
apiVersion: apps/v1
1715
kind: Deployment
1816
metadata:

‎examples/metrics/k8s-metrics-example.yaml

Whitespace-only changes.

‎examples/resource/job.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
114
apiVersion: batch/v1
215
kind: Job
316
metadata:

‎settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
pluginManagement {
1717
plugins {
18-
id "com.diffplug.spotless" version "5.9.0"
18+
id "com.diffplug.spotless" version "6.18.0"
1919
id 'nebula.release' version '15.2.0'
2020
id "com.github.johnrengelman.shadow" version "8.1.1"
2121
id 'com.google.cloud.tools.jib' version '3.1.4'

0 commit comments

Comments
 (0)
Please sign in to comment.