Skip to content

Commit 04cb74a

Browse files
authored
build(docs): drop the emptied builder page allow-list entry (#49)
Claude-Session: https://claude.ai/code/session_01JavEedb4MyR9NehY3HusTn
1 parent 2862ff3 commit 04cb74a

4 files changed

Lines changed: 6 additions & 33 deletions

File tree

‎docs/development/documentation.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ Rules for the generated files:
5959
the menu SVGs.
6060
- The generator reads no clock and no network. Fixed terrain comes from the test fixtures
6161
(`MemoryExtent`, `StrokeBuilder`, `Terrain`); the generator contains no copy of a brush algorithm.
62-
- Builder pages that still have no illustration are listed in
63-
`DocsLinkChecker.BUILDER_PAGES_AWAITING_ILLUSTRATIONS`. Remove the entry when the page embeds an
64-
image, and give a new builder page an image in the same pull request.
62+
- Every builder page needs an image or a link to the screenshot shotlist; `DocsLinkChecker` fails the
63+
build for a builder page that has neither, so give a new builder page an image in the same pull request.
6564

6665
Pages that embed each generated file:
6766

‎src/docsGen/java/net/onelitefeather/bettergopaint/docsgen/DocsGenerator.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static void main(String[] args) throws IOException {
6363
Map<String, byte[]> expected = expectedImages();
6464
report(DocsImages.problems(images, expected), expected.size() + " generated images match " + images);
6565
}
66-
default -> report(new DocsLinkChecker(docs, DocsLinkChecker.BUILDER_PAGES_AWAITING_ILLUSTRATIONS).problems(),
66+
default -> report(new DocsLinkChecker(docs).problems(),
6767
"all links and illustrations in " + docs + " resolve");
6868
}
6969
}

‎src/docsGen/java/net/onelitefeather/bettergopaint/docsgen/DocsLinkChecker.java‎

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import java.util.ArrayList;
2727
import java.util.List;
2828
import java.util.Optional;
29-
import java.util.Set;
3029
import java.util.regex.Matcher;
3130
import java.util.regex.Pattern;
3231
import java.util.stream.Stream;
@@ -43,13 +42,6 @@
4342
*/
4443
final class DocsLinkChecker {
4544

46-
/**
47-
* Builder pages that have no illustration yet, relative to {@code docs}. The change {@code builder-guides-with-images}
48-
* (PR #47) embeds an image or a shotlist link in each of them and removes its entry here. A new builder page gets an
49-
* illustration in the change that adds it, so this list never grows.
50-
*/
51-
static final Set<String> BUILDER_PAGES_AWAITING_ILLUSTRATIONS = Set.of("how-to/share-a-brush-as-an-item.md");
52-
5345
private static final String SUMMARY = "SUMMARY.md";
5446
private static final String SHOTLIST = "development/screenshot-shotlist.md";
5547
private static final Pattern LINK = Pattern.compile("\\[[^\\]]*\\]\\(([^)\\s]+)(?:\\s+\"[^\"]*\")?\\)");
@@ -61,16 +53,12 @@ final class DocsLinkChecker {
6153
private static final Pattern HINT_FILE = Pattern.compile("images/[A-Za-z0-9_./-]+");
6254

6355
private final Path docs;
64-
private final Set<String> builderPagesWithoutIllustration;
6556

6657
/**
67-
* @param docs the {@code docs} folder of the repository
68-
* @param builderPagesWithoutIllustration builder pages, relative to {@code docs}, that may have neither an image
69-
* nor a shotlist link
58+
* @param docs the {@code docs} folder of the repository
7059
*/
71-
DocsLinkChecker(Path docs, Set<String> builderPagesWithoutIllustration) {
60+
DocsLinkChecker(Path docs) {
7261
this.docs = docs;
73-
this.builderPagesWithoutIllustration = Set.copyOf(builderPagesWithoutIllustration);
7462
}
7563

7664
/**
@@ -102,9 +90,6 @@ List<String> problems() {
10290
private List<String> builderPageProblems() {
10391
List<String> problems = new ArrayList<>();
10492
for (String page : builderPages()) {
105-
if (builderPagesWithoutIllustration.contains(page)) {
106-
continue;
107-
}
10893
Path file = docs.resolve(page);
10994
if (!Files.isRegularFile(file)) {
11095
continue;

‎src/docsGenTest/java/net/onelitefeather/bettergopaint/docsgen/DocsLinkCheckerTest.java‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.nio.file.Files;
2828
import java.nio.file.Path;
2929
import java.util.List;
30-
import java.util.Set;
3130

3231
import static org.assertj.core.api.Assertions.assertThat;
3332

@@ -45,7 +44,7 @@ private void page(String relative, String content) throws IOException {
4544
}
4645

4746
private List<String> problems() {
48-
return new DocsLinkChecker(folder.resolve("docs"), Set.of()).problems();
47+
return new DocsLinkChecker(folder.resolve("docs")).problems();
4948
}
5049

5150
@Test
@@ -94,16 +93,6 @@ void builderPageWithoutIllustrationIsReported() throws IOException {
9493
.singleElement().asString().contains("how-to/share.md");
9594
}
9695

97-
@Test
98-
@DisplayName("a builder page on the allow-list passes without an illustration")
99-
void builderPageOnAllowListPasses() throws IOException {
100-
page("SUMMARY.md", "### For builders\n\n* [Share a brush](how-to/share.md)\n");
101-
page("how-to/share.md", "Text without a picture.");
102-
103-
assertThat(new DocsLinkChecker(folder.resolve("docs"), Set.of("how-to/share.md")).problems())
104-
.as("the problems of a builder page on the allow-list").isEmpty();
105-
}
106-
10796
@Test
10897
@DisplayName("a builder page with an image passes")
10998
void builderPageWithImagePasses() throws IOException {

0 commit comments

Comments
 (0)