Skip to content

Commit a86406b

Browse files
committed
Merge branch 'ci/optimize-fmt' of github.com:googleapis/google-cloud-java into ci/optimize-fmt
2 parents 8e38ca6 + b4705da commit a86406b

File tree

959 files changed

+177
-1946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

959 files changed

+177
-1946
lines changed

.kokoro/build.sh

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,21 @@ case ${JOB_TYPE} in
231231
dir=$(dirname "${dir}")
232232
done
233233
if [ -f "${dir}/pom.xml" ] && [ "${dir}" != "." ]; then
234-
# Exclude sample modules as they are not in the default reactor
235-
if [[ "${dir}" != *"samples"* ]]; then
236-
echo "Processed file: ${changed_file} -> resolved module: ${dir}"
234+
# Filter out samples, directories with no Java source code, and generated protobuf/gRPC code
235+
if [[ "${dir}" != *"samples"* ]] && \
236+
[[ "$(basename "${dir}")" != "proto-google-"* ]] && \
237+
[[ "$(basename "${dir}")" != "grpc-google-"* ]] && \
238+
[[ "$(basename "${dir}")" != *"-bom" ]] && \
239+
[[ "$(basename "${dir}")" != "google-cloud-pom-parent" ]] && \
240+
[[ "$(basename "${dir}")" != "google-cloud-jar-parent" ]]; then
241+
237242
changed_modules+=("${dir}")
238243
fi
239244
fi
240245
fi
241246
done <<< "${changed_file_list}"
242247

243-
echo "Changed Modules: ${changed_modules}"
248+
echo "Changed Modules: ${changed_modules[*]}"
244249

245250
# Deduplicate the modules using sort -u, so that we pass a concise list of unique modules
246251
# via the Maven `-pl` argument.
@@ -250,32 +255,8 @@ case ${JOB_TYPE} in
250255
echo "Formatting only changed modules: ${unique_modules}"
251256
fi
252257
else
253-
echo "BASE_SHA or HEAD_SHA is empty. Skipping file difference check."
254-
255-
# Build a list of exclusions to skip formatting generated code.
256-
exclusions=""
257-
258-
# Find and exclude generated sub-modules and parent/aggregator POMs:
259-
# - proto-google-*, grpc-google-* : Generated protobuf/gRPC code should not be formatted manually.
260-
# - *-bom : Bill of Materials modules that contain no valid source code anyway.
261-
# - java-* at depth 1 : Top-level aggregator parent POMs for each library module wrapper.
262-
# - google-cloud-pom-parent, google-cloud-jar-parent, gapic-libraries-bom : Repo-level parent modules.
263-
# The syntax for excluding in Maven requires a "!" prefix before the path in the `-pl` argument.
264-
for dir in $(find . -maxdepth 1 -type d -name "java-*" | sort; \
265-
find . -maxdepth 2 -type d \( -name "proto-google-*" -o -name "grpc-google-*" -o -name "*-bom" -o -name "google-cloud-pom-parent" -o -name "google-cloud-jar-parent" \) | sort); do
266-
# Strip leading ./
267-
dir="${dir#./}"
268-
if [ -n "${exclusions}" ]; then
269-
exclusions="${exclusions},!${dir}"
270-
else
271-
exclusions="!${dir}"
272-
fi
273-
done
274-
275-
if [ -n "${exclusions}" ]; then
276-
MODULE_FILTER="-pl ${exclusions}"
277-
echo "Excluding generated modules from formatting"
278-
fi
258+
echo "BASE_SHA or HEAD_SHA is empty. Cannot continue linting."
259+
exit 1
279260
fi
280261

281262
mvn -B -ntp \

java-accessapproval/google-cloud-accessapproval/src/test/java/com/google/cloud/accessapproval/v1/MockAccessApprovalImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//.
2-
/*
31
* Copyright 2026 Google LLC
42
*
53
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -261,3 +259,5 @@ public void getAccessApprovalServiceAccount(
261259
}
262260
}
263261
}
262+
// .
263+
// .

java-accessapproval/grpc-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/AccessApprovalGrpc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//.
2-
/*
31
* Copyright 2026 Google LLC
42
*
53
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -1839,3 +1837,5 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
18391837
return result;
18401838
}
18411839
}
1840+
// .
1841+
// .

java-accessapproval/proto-google-cloud-accessapproval-v1/src/main/java/com/google/cloud/accessapproval/v1/DeleteAccessApprovalSettingsMessageOrBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//.
2-
/*
31
* Copyright 2026 Google LLC
42
*
53
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -53,3 +51,5 @@ public interface DeleteAccessApprovalSettingsMessageOrBuilder
5351
*/
5452
com.google.protobuf.ByteString getNameBytes();
5553
}
54+
// .
55+
// .

java-accesscontextmanager/google-identity-accesscontextmanager/src/test/java/com/google/identity/accesscontextmanager/v1/AccessContextManagerClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//.
2-
/*
31
* Copyright 2026 Google LLC
42
*
53
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -2070,3 +2068,5 @@ public void testIamPermissionsExceptionTest() throws Exception {
20702068
}
20712069
}
20722070
}
2071+
// .
2072+
// .

java-accesscontextmanager/grpc-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/AccessContextManagerGrpc.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//.
2-
/*
31
* Copyright 2026 Google LLC
42
*
53
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -4571,3 +4569,5 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
45714569
return result;
45724570
}
45734571
}
4572+
// .
4573+
// .

java-accesscontextmanager/proto-google-identity-accesscontextmanager-type/src/main/java/com/google/identity/accesscontextmanager/type/DeviceEncryptionStatus.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//.
2-
/*
31
* Copyright 2026 Google LLC
42
*
53
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -218,3 +216,5 @@ private DeviceEncryptionStatus(int value) {
218216

219217
// @@protoc_insertion_point(enum_scope:google.identity.accesscontextmanager.type.DeviceEncryptionStatus)
220218
}
219+
// .
220+
// .

java-accesscontextmanager/proto-google-identity-accesscontextmanager-v1/src/main/java/com/google/identity/accesscontextmanager/v1/GetAccessLevelRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//.
2-
/*
31
* Copyright 2026 Google LLC
42
*
53
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -860,3 +858,5 @@ public com.google.protobuf.Parser<GetAccessLevelRequest> getParserForType() {
860858
return DEFAULT_INSTANCE;
861859
}
862860
}
861+
// .
862+
// .

java-admanager/ad-manager/src/test/java/com/google/ads/admanager/v1/CustomFieldServiceClientTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//.
2-
/*
31
* Copyright 2026 Google LLC
42
*
53
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -806,3 +804,5 @@ public void batchDeactivateCustomFieldsExceptionTest2() throws Exception {
806804
}
807805
}
808806
}
807+
// .
808+
// .

java-admanager/proto-ad-manager-v1/src/main/java/com/google/ads/admanager/v1/MobileDeviceSubmodelName.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//.
2-
/*
31
* Copyright 2026 Google LLC
42
*
53
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -200,3 +198,5 @@ public MobileDeviceSubmodelName build() {
200198
}
201199
}
202200
}
201+
// .
202+
// .

0 commit comments

Comments
 (0)