Skip to content

Commit 6118b21

Browse files
committed
Use set to track files without comments
1 parent 8e0b72e commit 6118b21

File tree

1 file changed

+4
-1
lines changed
  • codegen/core/src/main/java/software/amazon/smithy/python/codegen/writer

1 file changed

+4
-1
lines changed

codegen/core/src/main/java/software/amazon/smithy/python/codegen/writer/PythonWriter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public final class PythonWriter extends SymbolWriter<PythonWriter, ImportDeclara
4040

4141
private static final Logger LOGGER = Logger.getLogger(PythonWriter.class.getName());
4242
private static final MarkdownToRstDocConverter DOC_CONVERTER = MarkdownToRstDocConverter.getInstance();
43+
private static final Set<String> FILES_WITHOUT_COMMENTS = Set.of(
44+
"LICENSE",
45+
"NOTICE");
4346

4447
private final String fullPackageName;
4548
private final String commentStart;
@@ -92,7 +95,7 @@ public PythonWriter apply(String filename, String namespace) {
9295
String commentStart = "#";
9396
// Markdown doesn't have comments, so there's no non-intrusive way to
9497
// add the warning.
95-
if (filename.endsWith(".md") || filename.equals("LICENSE") || filename.equals("NOTICE")) {
98+
if (filename.endsWith(".md") || FILES_WITHOUT_COMMENTS.contains(filename)) {
9699
commentStart = "";
97100
} else if (filename.endsWith(".rst")) {
98101
commentStart = "..\n ";

0 commit comments

Comments
 (0)