test(11.1-06): plant one fixture per docs checker rule and run them in the gate

- testdata/clean passes every check; 63 violation cases each overlay one
  fault and a want.txt naming the single problem it must produce
- TestPlantedViolations also plants the forbidden name (split literals)
  and symlink escapes at run time; TestBuildOutputGuard covers --out
- check-phase11.1.sh --self-test runs the corpus through a go test -json
  detector that refuses FAIL, SKIP, zero tests and no tests to run
- the self-test scratch copy now carries examples/ and README.md, so its
  baseline sees the example command literals the real tree sees
This commit is contained in:
Jakub Zych
2026-09-30 23:52:19 +02:00
parent 4c68d31862
commit 1d38e73f03
154 changed files with 1998 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
---
title: Start
description: "Install the demo and greet someone."
section: guide
order: 10
---
# Start
The demo module greets people.
## Install
Build the docs with `summer docs:build`, or run the application:
```sh
$ summer docs:build --out site
./bin/demo serve --addr 127.0.0.1:8080
```
## Greet someone
Call `demo.Hello`:
```go src=modules/demo/example_test.go#ExampleHello
fmt.Println(demo.Hello("blog"))
// Output: Hello, blog
```
> [!TIP]
> The [demo reference](../../modules/demo/README.md#usage) lists the whole API.
Continue with [configuration](config.md) or jump back to [install](#install).
See [usage](../extras/usage.md#nope).

View File

@@ -0,0 +1,3 @@
rule: link
file: docs/guide/start.md
message: #nope not found in docs/extras/usage.md

View File

@@ -0,0 +1,34 @@
---
title: Start
description: "Install the demo and greet someone."
section: guide
order: 10
---
# Start
The demo module greets people.
## Install
Build the docs with `summer docs:build`, or run the application:
```sh
$ summer docs:build --out site
./bin/demo serve --addr 127.0.0.1:8080
```
## Greet someone
Call `demo.Hello`:
```go src=modules/demo/example_test.go#ExampleHello
fmt.Println(demo.Hello("blog"))
// Output: Hello, blog
```
> [!TIP]
> The [demo reference](../../modules/demo/README.md#usage) lists the whole API.
Continue with [configuration](config.md) or jump back to [install](#install).
Back to [nowhere](#nope).

View File

@@ -0,0 +1,3 @@
rule: link
file: docs/guide/start.md
message: #nope not found in docs/guide/start.md

View File

@@ -0,0 +1,22 @@
# demo
Demo greets people by name.
```go
import "example.com/docfixture/modules/demo"
```
## Usage
Call `demo.Hello` or build a `demo.Greeter` and call `demo.Greeter.Greet`.
See the [start guide](../../docs/guide/start.md#install).
## Testing
```sh
go test ./modules/demo
```
> [!CAUTION]
> Planted.

View File

@@ -0,0 +1,3 @@
rule: callout
file: modules/demo/README.md
message: unknown type CAUTION

View File

@@ -0,0 +1,18 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
> [!DANGER]
> Planted.

View File

@@ -0,0 +1,3 @@
rule: callout
file: docs/extras/faq.md
message: unknown type DANGER (use NOTE, TIP or WARNING)

View File

@@ -0,0 +1,19 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
```bash
cd app && summer serve
```

View File

@@ -0,0 +1,3 @@
rule: command
file: docs/extras/faq.md
message: "serve" is not a summer or application command

View File

@@ -0,0 +1,19 @@
# demo
Demo greets people by name.
```go
import "example.com/docfixture/modules/demo"
```
## Usage
Call `demo.Hello` or build a `demo.Greeter` and call `demo.Greeter.Greet`.
See the [start guide](../../docs/guide/start.md#install).
## Testing
```sh
./bin/demo demo:nope
```

View File

@@ -0,0 +1,3 @@
rule: command
file: modules/demo/README.md
message: "demo:nope" is not a summer or application command

View File

@@ -0,0 +1,19 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
```sh
./bin/demo no:such --force
```

View File

@@ -0,0 +1,3 @@
rule: command
file: docs/extras/faq.md
message: "no:such" is not a summer or application command

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
Then run `summer no:such`.

View File

@@ -0,0 +1,3 @@
rule: command
file: docs/extras/faq.md
message: "no:such" is not a summer or application command

View File

@@ -0,0 +1,9 @@
---
title: Extra
description: "Extra page."
section: api
order: 90
---
# Extra
Text.

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/api/extra.md
message: section "api" is reserved for the ingested module READMEs

View File

@@ -0,0 +1,15 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: twenty
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/extras/faq.md
message: cannot unmarshal string into Go struct field Frontmatter.Order

View File

@@ -0,0 +1,20 @@
---
title: Config
description: "Configure the demo database."
section: guide
order: 10
---
# Config
The database block of `config/app.yaml`:
```yaml src=config/app.yaml#db
db:
host: localhost
port: 5432
```
## Settings
> [!WARNING]
> Keep the port in step with the database server.

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/guide/start.md
message: order 10 already used by docs/guide/config.md

View File

@@ -0,0 +1,20 @@
---
title: Config
description: "Configure the demo database."
section: guide
order: 20
---
# Configuration
The database block of `config/app.yaml`:
```yaml src=config/app.yaml#db
db:
host: localhost
port: 5432
```
## Settings
> [!WARNING]
> Keep the port in step with the database server.

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/guide/config.md
message: first line must be "# Config"

View File

@@ -0,0 +1,12 @@
---
title: Demo docs
description: "The landing page of the clean fixture."
section: guide
order: 0
---
# Demo docs
Start with the [start guide](guide/start.md), then read [usage](extras/usage.md#call-it).
> [!NOTE]
> Every page of this fixture passes every check.

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/index.md
message: the landing page uses section "index"

View File

@@ -0,0 +1,20 @@
---
title: Config
description: "Configure the demo database. Configure the demo database. Configure the demo database. Configure the demo database. Configure the demo database. Configure the demo database. "
section: guide
order: 20
---
# Config
The database block of `config/app.yaml`:
```yaml src=config/app.yaml#db
db:
host: localhost
port: 5432
```
## Settings
> [!WARNING]
> Keep the port in step with the database server.

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/guide/config.md
message: description is longer than 160 characters

View File

@@ -0,0 +1,14 @@
---
title: FAQ
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/extras/faq.md
message: missing field "description"

View File

@@ -0,0 +1,14 @@
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/extras/faq.md
message: the file must start with a "---" frontmatter block

View File

@@ -0,0 +1,9 @@
---
title: Stray
description: "Stray page."
section: guide
order: 90
---
# Stray
Text.

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/stray.md
message: only index.md sits at the docs root

View File

@@ -0,0 +1,20 @@
---
title: Config
description: "Configure the demo database."
section: extras
order: 30
---
# Config
The database block of `config/app.yaml`:
```yaml src=config/app.yaml#db
db:
host: localhost
port: 5432
```
## Settings
> [!WARNING]
> Keep the port in step with the database server.

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/guide/config.md
message: section "extras" does not match directory "guide"

View File

@@ -0,0 +1,6 @@
---
title: Draft
description: x
section: extras
order: 90
# Draft

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/extras/draft.md
message: the file must start with a "---" frontmatter block

View File

@@ -0,0 +1,16 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
colour: red
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/extras/faq.md
message: unknown field "colour"

View File

@@ -0,0 +1,9 @@
---
title: Extra
description: "Extra page."
section: other
order: 90
---
# Extra
Text.

View File

@@ -0,0 +1,3 @@
rule: frontmatter
file: docs/other/extra.md
message: section "other" is not listed in docs/site.yaml

View File

@@ -0,0 +1,19 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
```go
x := 1
```

View File

@@ -0,0 +1,3 @@
rule: snippet
file: docs/extras/faq.md
message: go code block has no src= reference

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
## Visit <https://example.com>

View File

@@ -0,0 +1,3 @@
rule: heading
file: docs/extras/faq.md
message: headings must be plain ASCII text without links or code

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
## Use `demo.Hello`

View File

@@ -0,0 +1,3 @@
rule: heading
file: docs/extras/faq.md
message: headings must be plain ASCII text without links or code

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
## See [usage](usage.md)

View File

@@ -0,0 +1,3 @@
rule: heading
file: docs/extras/faq.md
message: headings must be plain ASCII text without links or code

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
## Zażółć gęślą

View File

@@ -0,0 +1,3 @@
rule: heading
file: docs/extras/faq.md
message: headings must be plain ASCII text without links or code

View File

@@ -0,0 +1 @@
package util

View File

@@ -0,0 +1 @@
package util

View File

@@ -0,0 +1,3 @@
rule: identifier
file: modules/other/util
message: package name "util" is used by modules/demo/util and modules/other/util

View File

@@ -0,0 +1,19 @@
# demo
Demo greets people by name.
```go
import "example.com/docfixture/modules/demo"
```
## Usage
Call `demo.Gone` or build a `demo.Greeter` and call `demo.Greeter.Greet`.
See the [start guide](../../docs/guide/start.md#install).
## Testing
```sh
go test ./modules/demo
```

View File

@@ -0,0 +1,3 @@
rule: identifier
file: modules/demo/README.md
message: demo.Gone does not exist in modules/demo

View File

@@ -0,0 +1,3 @@
# Docs fixture
The clean fixture for the docs checkers. `demo.Bye` is checked here too.

View File

@@ -0,0 +1,3 @@
rule: identifier
file: README.md
message: demo.Bye does not exist in modules/demo

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
See `demo.Greeter.Nope`.

View File

@@ -0,0 +1,3 @@
rule: identifier
file: docs/extras/faq.md
message: demo.Greeter.Nope does not exist in modules/demo

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
See `demo.Missing`.

View File

@@ -0,0 +1,3 @@
rule: identifier
file: docs/extras/faq.md
message: demo.Missing does not exist in modules/demo

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
See [root](/index.html).

View File

@@ -0,0 +1,3 @@
rule: link
file: docs/extras/faq.md
message: /index.html does not resolve

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
See [missing](missing.md).

View File

@@ -0,0 +1,3 @@
rule: link
file: docs/extras/faq.md
message: missing.md does not resolve

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
See [nothing]().

View File

@@ -0,0 +1,3 @@
rule: link
file: docs/extras/faq.md
message: empty link destination does not resolve

View File

@@ -0,0 +1,19 @@
# demo
Demo greets people by name.
```go
import "example.com/docfixture/modules/demo"
```
## Usage
Call `demo.Hello` or build a `demo.Greeter` and call `demo.Greeter.Greet`.
See the [start guide](../../docs/guide/nope.md).
## Testing
```sh
go test ./modules/demo
```

View File

@@ -0,0 +1,3 @@
rule: link
file: modules/demo/README.md
message: ../../docs/guide/nope.md does not resolve

View File

@@ -0,0 +1,17 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
See [source](../../modules/demo/demo.go).

View File

@@ -0,0 +1,3 @@
rule: link
file: docs/extras/faq.md
message: ../../modules/demo/demo.go does not resolve

View File

@@ -0,0 +1 @@
docs/index.md

View File

@@ -0,0 +1,3 @@
rule: page
file: docs/index.md
message: the landing page is missing

View File

@@ -0,0 +1,2 @@
// Package extra has no README.
package extra

View File

@@ -0,0 +1,3 @@
rule: readme
file: modules/extra
message: package has Go files but no README.md

View File

@@ -0,0 +1,3 @@
extra
No H1 title.

View File

@@ -0,0 +1,2 @@
// Package extra has a bad README.
package extra

View File

@@ -0,0 +1,3 @@
rule: readme
file: modules/extra/README.md
message: first line must be the "# <module>" title

View File

@@ -0,0 +1,16 @@
title: Demo
description: "Demo is the clean docs checker fixture."
base_url: ""
edit_url: "https://forge.example/edit/{path}"
source_url: "https://forge.example/src/{path}"
llms_notes:
- "Every page of this fixture passes every check."
sections:
- name: guide
title: Guide
- name: extras
title: Extras
- name: empty
title: Empty
- name: api
title: API reference

View File

@@ -0,0 +1,3 @@
rule: section
file: docs/site.yaml
message: "empty" has no pages

View File

@@ -0,0 +1,16 @@
title: Demo
description: "Demo is the clean docs checker fixture."
base_url: ""
edit_url: "https://forge.example/edit/{path}"
source_url: "https://forge.example/src/{path}"
llms_notes:
- "Every page of this fixture passes every check."
sections:
- name: guide
title: Guide
- name: extras
title: Extras
- name: guide
title: Again
- name: api
title: API reference

View File

@@ -0,0 +1,3 @@
rule: site
file: docs/site.yaml
message: section "guide" is listed twice

View File

@@ -0,0 +1,15 @@
title: Demo
description: "Demo is the clean docs checker fixture."
colour: red
base_url: ""
edit_url: "https://forge.example/edit/{path}"
source_url: "https://forge.example/src/{path}"
llms_notes:
- "Every page of this fixture passes every check."
sections:
- name: guide
title: Guide
- name: extras
title: Extras
- name: api
title: API reference

View File

@@ -0,0 +1,3 @@
rule: site
file: docs/site.yaml
message: parse site config

View File

@@ -0,0 +1,18 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
```text src=/etc/hostname
```

View File

@@ -0,0 +1,3 @@
rule: snippet
file: docs/extras/faq.md
message: path must be relative to the repository root

View File

@@ -0,0 +1,18 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
```text src=config\app.yaml
```

View File

@@ -0,0 +1,3 @@
rule: snippet
file: docs/extras/faq.md
message: path must use forward slashes

View File

@@ -0,0 +1,18 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
```text src=config
```

View File

@@ -0,0 +1,3 @@
rule: snippet
file: docs/extras/faq.md
message: path is a directory

View File

@@ -0,0 +1,18 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
```text src=../outside.txt
```

View File

@@ -0,0 +1,3 @@
rule: snippet
file: docs/extras/faq.md
message: path must not leave the repository root

View File

@@ -0,0 +1,18 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
```text src=.env
```

View File

@@ -0,0 +1,3 @@
rule: snippet
file: docs/extras/faq.md
message: path names a dotfile or .env file

View File

@@ -0,0 +1,32 @@
---
title: Start
description: "Install the demo and greet someone."
section: guide
order: 10
---
# Start
The demo module greets people.
## Install
Build the docs with `summer docs:build`, or run the application:
```sh
$ summer docs:build --out site
./bin/demo serve --addr 127.0.0.1:8080
```
## Greet someone
Call `demo.Hello`:
```go src=modules/demo/example_test.go#ExampleHello
fmt.Println(demo.Hello("docs"))
// Output: Hello, blog
```
> [!TIP]
> The [demo reference](../../modules/demo/README.md#usage) lists the whole API.
Continue with [configuration](config.md) or jump back to [install](#install).

View File

@@ -0,0 +1,3 @@
rule: snippet
file: docs/guide/start.md
message: body differs from modules/demo/example_test.go#ExampleHello (run: summer docs:sync)

View File

@@ -0,0 +1 @@
SECRET=1

View File

@@ -0,0 +1,18 @@
---
title: FAQ
description: "Questions about the demo."
section: extras
order: 20
---
# FAQ
## Does it migrate
Yes, run `./bin/demo migrate`, then `summer docs:sync` after a source change.
```text
summer not:checked in a text fence
```
```text src=config/prod.env
```

Some files were not shown because too many files have changed in this diff Show More