Skip to content

Commit cb7fa35

Browse files
committed
Don't store line numbers file
1 parent 6983cd8 commit cb7fa35

File tree

2 files changed

+4
-194
lines changed

2 files changed

+4
-194
lines changed

snippets_line_numbers.csv

Lines changed: 0 additions & 189 deletions
This file was deleted.

src/main/java/AggregateSnippets.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,18 @@ public static void main(String[] args) throws Throwable {
3535
final var aggregator = new AggregateSnippets(snippetsSrcRoot);
3636
aggregator.computeContents();
3737
aggregator.saveContentsToFile(repoRoot.resolve("SNIPPETS.md"));
38-
aggregator.saveLineNumbersToCsv(repoRoot.resolve("snippets_line_numbers.csv"));
3938
}
4039

4140

42-
public record CodeSnippetFile(
41+
public record CodeSnippetFileInfo(
4342
Path file,
4443
int mainStartIndex, int mainEndIndex,
4544
int clientStartIndex, int clientEndIndex
4645
) { }
4746

4847
private StringBuilder sb;
4948
private final Path snippetsSrcRoot;
50-
private Collection<CodeSnippetFile> snippetFiles;
49+
private Collection<CodeSnippetFileInfo> snippetFiles;
5150

5251
public AggregateSnippets(Path snippetsSrcRoot) {
5352
this.snippetsSrcRoot = Objects.requireNonNull(snippetsSrcRoot);
@@ -59,7 +58,7 @@ private void checkComputed() {
5958
}
6059
}
6160

62-
public Collection<CodeSnippetFile> getLineNumbers() {
61+
public Collection<CodeSnippetFileInfo> getLineNumbers() {
6362
checkComputed();
6463
return snippetFiles;
6564
}
@@ -163,7 +162,7 @@ else if (level > 2 && path.getName().endsWith(".java")) {
163162
sb.append("\n```java\n").append(nugget).append("\n```\n");
164163

165164
boolean standalone = clientInitEndIndex < 12;
166-
snippetFiles.add(new CodeSnippetFile(path.toPath(),
165+
snippetFiles.add(new CodeSnippetFileInfo(path.toPath(),
167166
lineNumberFromIndex(fileContent, startIndex) + 1,
168167
lineNumberFromIndex(fileContent, endIndex),
169168
standalone ? -1 : lineNumberFromIndex(fileContent, clientInitStartIndex) + 1,

0 commit comments

Comments
 (0)