Skip to content

Commit 6a40003

Browse files
committed
Add period at the end of comments
1 parent 3e89a6c commit 6a40003

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/StructuredMemberWriter.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import software.amazon.smithy.model.shapes.MapShape;
2525
import software.amazon.smithy.model.shapes.MemberShape;
2626
import software.amazon.smithy.model.shapes.Shape;
27-
import software.amazon.smithy.model.shapes.SimpleShape;
2827
import software.amazon.smithy.model.shapes.StructureShape;
2928
import software.amazon.smithy.model.traits.IdempotencyTokenTrait;
3029
import software.amazon.smithy.model.traits.SensitiveTrait;
@@ -71,47 +70,47 @@ void writeMembers(TypeScriptWriter writer, Shape shape) {
7170
}
7271

7372
/**
74-
* Recursively writes filterSensitiveLog for arrays (CollectionShape)
73+
* Recursively writes filterSensitiveLog for CollectionShape.
7574
*/
7675
void writeCollectionFilterSensitiveLog(TypeScriptWriter writer, MemberShape collectionMember) {
7776
Shape memberShape = model.expectShape(collectionMember.getTarget());
7877
if (memberShape instanceof StructureShape) {
79-
// Call filterSensitiveLog on Structure
78+
// Call filterSensitiveLog on Structure.
8079
writer.write("${T}.filterSensitiveLog", symbolProvider.toSymbol(collectionMember));
8180
} else if (memberShape instanceof CollectionShape) {
82-
// Iterate over array items, and call array specific function on each member
81+
// Iterate over array items, and call array specific function on each member.
8382
writer.openBlock("item => item.map(", ")",
8483
() -> {
8584
MemberShape nestedCollectionMember = ((CollectionShape) memberShape).getMember();
8685
writeCollectionFilterSensitiveLog(writer, nestedCollectionMember);
8786
}
8887
);
8988
} else if (memberShape instanceof MapShape) {
90-
// Iterate over Object entries, and call reduce to repopulate map
89+
// Iterate over Object entries, and call reduce to repopulate map.
9190
writer.openBlock("item => Object.entries(item).reduce(", ")",
9291
() -> {
9392
MemberShape mapMember = ((MapShape) memberShape).getValue();
9493
writeMapFilterSensitiveLog(writer, mapMember);
9594
}
9695
);
9796
} else {
98-
// This path will never reach because of recursive isIterationRequired
99-
// adding it to not break the code, if it does reach in future
97+
// This path will never reach because of recursive isIterationRequired.
98+
// Adding it to not break the code, if it does reach in future.
10099
writer.write("item => item");
101100
}
102101
}
103102

104103
/**
105-
* Recursively writes filterSensitiveLog for MapShape
104+
* Recursively writes filterSensitiveLog for MapShape.
106105
*/
107106
void writeMapFilterSensitiveLog(TypeScriptWriter writer, MemberShape mapMember) {
108-
// Reducer is common to all shapes
107+
// Reducer is common to all shapes.
109108
writer.openBlock("(acc: any, [key, value]: [string, ${T}]) => {", "}, {}",
110109
symbolProvider.toSymbol(mapMember),
111110
() -> {
112111
Shape memberShape = model.expectShape(mapMember.getTarget());
113112
if (memberShape instanceof StructureShape) {
114-
// Call filterSensitiveLog on Structure
113+
// Call filterSensitiveLog on Structure.
115114
writer.write("acc[key] = ${T}.filterSensitiveLog(value);",
116115
symbolProvider.toSymbol(mapMember));
117116
} else if (memberShape instanceof CollectionShape) {
@@ -129,8 +128,8 @@ void writeMapFilterSensitiveLog(TypeScriptWriter writer, MemberShape mapMember)
129128
}
130129
);
131130
} else {
132-
// This path will never reach because of recursive isIterationRequired
133-
// adding it to not break the code, if it does reach in future
131+
// This path will never reach because of recursive isIterationRequired.
132+
// Adding it to not break the code, if it does reach in future.
134133
writer.write("acc[key] = value;");
135134
}
136135
writer.write("return acc;");
@@ -144,16 +143,16 @@ void writeFilterSensitiveLog(TypeScriptWriter writer, Shape shape) {
144143
Shape memberShape = model.expectShape(member.getTarget());
145144
String memberName = TypeScriptUtils.sanitizePropertyName(symbolProvider.toMemberName(member));
146145
if (member.getMemberTrait(model, SensitiveTrait.class).isPresent()) {
147-
// member is Sensitive, hide the value
146+
// member is Sensitive, hide the value.
148147
writer.write("...(obj.${L} && { ${L}: SENSITIVE_STRING }),", memberName, memberName);
149148
} else if (memberShape instanceof StructureShape) {
150-
// Call filterSensitiveLog on Structure
149+
// Call filterSensitiveLog on Structure.
151150
writer.write("...(obj.${L} && { ${L}: ${T}.filterSensitiveLog(obj.${L})}),",
152151
memberName, memberName, symbolProvider.toSymbol(member), memberName);
153152
} else if (memberShape instanceof CollectionShape) {
154153
MemberShape collectionMember = ((CollectionShape) memberShape).getMember();
155154
if (isIterationRequired(collectionMember)) {
156-
// Iterate over array items, and call array specific function on each member
155+
// Iterate over array items, and call array specific function on each member.
157156
writer.openBlock("...(obj.${L} && { ${L}: obj.${L}.map(", ")}),",
158157
memberName, memberName, memberName,
159158
() -> {
@@ -164,7 +163,7 @@ void writeFilterSensitiveLog(TypeScriptWriter writer, Shape shape) {
164163
} else if (memberShape instanceof MapShape) {
165164
MemberShape mapMember = ((MapShape) memberShape).getValue();
166165
if (isIterationRequired(mapMember)) {
167-
// Iterate over Object entries, and call reduce to repopulate map
166+
// Iterate over Object entries, and call reduce to repopulate map.
168167
writer.openBlock("...(obj.${L} && { ${L}: Object.entries(obj.${L}).reduce(", ")}),",
169168
memberName, memberName, memberName,
170169
() -> {
@@ -177,10 +176,10 @@ void writeFilterSensitiveLog(TypeScriptWriter writer, Shape shape) {
177176
}
178177

179178
/**
180-
* Identifies if iteration is required on MemberShape
179+
* Identifies if iteration is required on MemberShape.
181180
*
182-
* @param memberShape a {@link MemberShape} to check for iteration required
183-
* @return Returns true if the iteration is required on memberShape
181+
* @param memberShape a {@link MemberShape} to check for iteration required.
182+
* @return Returns true if the iteration is required on memberShape.
184183
*/
185184
private boolean isIterationRequired(MemberShape memberShape) {
186185
Shape targetShape = model.expectShape(memberShape.getTarget());

0 commit comments

Comments
 (0)