Skip to content

Commit 0ca7227

Browse files
author
Chase Coalwell
authored
fix(codegen): checkstyle violations (#1467)
1 parent e72a9dc commit 0ca7227

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAwsRuntimeConfig.java

+10-8
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* <li>credentialDefaultProvider: Provides credentials if no credentials
4444
* are explicitly provided.</li>
4545
* <li>region: The AWS region to which this client will send requests</li>
46-
* <li>maxAttempts: Provides value for how many times a request will be
46+
* <li>maxAttempts: Provides value for how many times a request will be
4747
* made at most in case of retry.</li>
4848
* </ul>
4949
*
@@ -53,7 +53,7 @@
5353
* <li>signingName: Sets this to the signing name derived from the model.</li>
5454
* <li>credentialDefaultProvider: Uses the default credential provider that
5555
* checks things like environment variables and the AWS config file.</li>
56-
* <li>region: Uses the default region provider that checks things like
56+
* <li>region: Uses the default region provider that checks things like
5757
* environment variables and the AWS config file.</li>
5858
* <li>maxAttempts: Uses the default maxAttempts provider that checks things
5959
* like environment variables and the AWS config file.</li>
@@ -147,7 +147,8 @@ private Map<String, Consumer<TypeScriptWriter>> getDefaultConfig(LanguageTarget
147147
},
148148
"maxAttempts", writer -> {
149149
writer.addDependency(TypeScriptDependency.MIDDLEWARE_RETRY);
150-
writer.addImport("DEFAULT_MAX_ATTEMPTS", "DEFAULT_MAX_ATTEMPTS", TypeScriptDependency.MIDDLEWARE_RETRY.packageName);
150+
writer.addImport("DEFAULT_MAX_ATTEMPTS", "DEFAULT_MAX_ATTEMPTS",
151+
TypeScriptDependency.MIDDLEWARE_RETRY.packageName);
151152
writer.write("maxAttempts: DEFAULT_MAX_ATTEMPTS,");
152153
}
153154
);
@@ -161,12 +162,12 @@ private Map<String, Consumer<TypeScriptWriter>> getDefaultConfig(LanguageTarget
161162
},
162163
"region", writer -> {
163164
writer.addDependency(AwsDependency.NODE_CONFIG_PROVIDER);
164-
writer.addImport("loadConfig", "loadNodeConfig",
165+
writer.addImport("loadConfig", "loadNodeConfig",
165166
AwsDependency.NODE_CONFIG_PROVIDER.packageName);
166167
writer.addDependency(TypeScriptDependency.CONFIG_RESOLVER);
167168
writer.addImport("NODE_REGION_CONFIG_OPTIONS", "NODE_REGION_CONFIG_OPTIONS",
168169
TypeScriptDependency.CONFIG_RESOLVER.packageName);
169-
writer.addImport("NODE_REGION_CONFIG_FILE_OPTIONS", "NODE_REGION_CONFIG_FILE_OPTIONS",
170+
writer.addImport("NODE_REGION_CONFIG_FILE_OPTIONS", "NODE_REGION_CONFIG_FILE_OPTIONS",
170171
TypeScriptDependency.CONFIG_RESOLVER.packageName);
171172
writer.write(
172173
"region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),");
@@ -201,7 +202,8 @@ private Map<String, Consumer<TypeScriptWriter>> getCognitoIdentityConfig(Languag
201202
},
202203
"maxAttempts", writer -> {
203204
writer.addDependency(TypeScriptDependency.MIDDLEWARE_RETRY);
204-
writer.addImport("DEFAULT_MAX_ATTEMPTS", "DEFAULT_MAX_ATTEMPTS", TypeScriptDependency.MIDDLEWARE_RETRY.packageName);
205+
writer.addImport("DEFAULT_MAX_ATTEMPTS", "DEFAULT_MAX_ATTEMPTS",
206+
TypeScriptDependency.MIDDLEWARE_RETRY.packageName);
205207
writer.write("maxAttempts: DEFAULT_MAX_ATTEMPTS,");
206208
}
207209
);
@@ -220,12 +222,12 @@ private Map<String, Consumer<TypeScriptWriter>> getCognitoIdentityConfig(Languag
220222
},
221223
"region", writer -> {
222224
writer.addDependency(AwsDependency.NODE_CONFIG_PROVIDER);
223-
writer.addImport("loadConfig", "loadNodeConfig",
225+
writer.addImport("loadConfig", "loadNodeConfig",
224226
AwsDependency.NODE_CONFIG_PROVIDER.packageName);
225227
writer.addDependency(TypeScriptDependency.CONFIG_RESOLVER);
226228
writer.addImport("NODE_REGION_CONFIG_OPTIONS", "NODE_REGION_CONFIG_OPTIONS",
227229
TypeScriptDependency.CONFIG_RESOLVER.packageName);
228-
writer.addImport("NODE_REGION_CONFIG_FILE_OPTIONS", "NODE_REGION_CONFIG_FILE_OPTIONS",
230+
writer.addImport("NODE_REGION_CONFIG_FILE_OPTIONS", "NODE_REGION_CONFIG_FILE_OPTIONS",
229231
TypeScriptDependency.CONFIG_RESOLVER.packageName);
230232
writer.write(
231233
"region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),");

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3Config.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public void addConfigInterfaceFields(TypeScriptSettings settings, Model model, S
4444
writer.writeDocs("Whether to escape request path when signing the request.")
4545
.write("signingEscapePath?: boolean;\n");
4646
writer.writeDocs(
47-
"Whether to override the request region with the region inferred from requested resource's ARN. Defaults to false.")
47+
"Whether to override the request region with the region inferred from requested resource's ARN."
48+
+ " Defaults to false.")
4849
.addImport("Provider", "Provider", TypeScriptDependency.AWS_SDK_TYPES.packageName)
4950
.write("useArnRegion?: boolean | Provider<boolean>;");
5051
}

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/EndpointGenerator.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private void writePartitionEndpointResolver(Partition partition) {
172172
writer.openBlock("regionInfo = {", "};", () -> {
173173
String template = partition.templateVariableName;
174174
writer.write("hostname: $L.replace(\"{region}\", region),", template);
175-
writer.write("partition: $S,", partition.ID);
175+
writer.write("partition: $S,", partition.identifier);
176176
writeAdditionalEndpointSettings(partition.getDefaults());
177177
});
178178
}
@@ -183,7 +183,7 @@ private void writeEndpointSpecificResolver(String region, ObjectNode resolved) {
183183
String hostname = resolved.expectStringMember("hostname").getValue();
184184
writer.openBlock("regionInfo = {", "};", () -> {
185185
writer.write("hostname: $S,", hostname);
186-
writer.write("partition: $S,", regionPartitionsMap.get(region).ID);
186+
writer.write("partition: $S,", regionPartitionsMap.get(region).identifier);
187187
writeAdditionalEndpointSettings(resolved);
188188
});
189189
}
@@ -206,7 +206,7 @@ private final class Partition {
206206
final String templateVariableName;
207207
final String templateValue;
208208
final String dnsSuffix;
209-
final String ID;
209+
final String identifier;
210210
private final ObjectNode config;
211211

212212
private Partition(ObjectNode config, String partition) {
@@ -227,7 +227,7 @@ private Partition(ObjectNode config, String partition) {
227227
regionVariableName = snakePartition + "_REGIONS";
228228

229229
dnsSuffix = config.expectStringMember("dnsSuffix").getValue();
230-
ID = partition;
230+
identifier = partition;
231231
}
232232

233233
ObjectNode getDefaults() {

0 commit comments

Comments
 (0)