You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
why: Code block guidance drifted into four variants
across repos.
what:
- Merge the code block and shell command sections
- Lead with the paste-and-run contract
Copy file name to clipboardExpand all lines: AGENTS.md
+22-56Lines changed: 22 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -437,72 +437,38 @@ EOF
437
437
438
438
## Documentation Standards
439
439
440
-
### Code Blocks in Documentation
441
-
442
-
When writing documentation (README, CHANGES, docs/), follow these rules for code blocks:
443
-
444
-
**One command per code block.** This makes commands individually copyable. For sequential commands, either use separate code blocks or chain them with `&&` or `;` and `\` continuations (keeping it one logical command).
445
-
446
-
**Put explanations outside the code block**, not as comments inside.
440
+
### Code Blocks
441
+
442
+
Code blocks are paste-and-run units: pasting one block runs exactly one
443
+
intended action. Doctests and other executed examples are exempt — the test
444
+
suite runs them, nobody pastes them.
445
+
446
+
-**One command per block.** Multiple steps may share a block only when
447
+
explicitly chained with `&&`, `;`, or `\` continuations — the chain is
448
+
then one logical command.
449
+
-**Explanations go in prose above the block**, never as `#` comments inside it.
450
+
-**Command menus are per-command blocks with prose lead-ins**, not tables.
451
+
-**Shell commands use the `console` tag with a `$ ` prefix.** This separates
452
+
interactive commands from scripts and enables prompt-aware copy.
453
+
-**Split long commands with `\`** — one flag or flag+value pair per indented
454
+
continuation line, positional arguments last.
447
455
448
456
Good:
449
457
450
-
Run the tests:
451
-
452
-
```console
453
-
$ uv run pytest
454
-
```
455
-
456
-
Run with coverage:
457
-
458
-
```console
459
-
$ uv run pytest --cov
460
-
```
461
-
462
-
Bad:
463
-
464
-
```console
465
-
# Run the tests
466
-
$ uv run pytest
467
-
468
-
# Run with coverage
469
-
$ uv run pytest --cov
470
-
```
471
-
472
-
### Shell Command Formatting
473
-
474
-
These rules apply to shell commands in documentation (README, CHANGES, docs/), **not** to Python doctests.
475
-
476
-
**Use `console` language tag with `$ ` prefix.** This distinguishes interactive commands from scripts and enables prompt-aware copy in many terminals.
477
-
478
-
Good:
479
-
480
-
```console
481
-
$ uv run pytest
482
-
```
483
-
484
-
Bad:
485
-
486
-
```bash
487
-
uv run pytest
488
-
```
489
-
490
-
**Split long commands with `\` for readability.** Each flag or flag+value pair gets its own continuation line, indented. Positional parameters go on the final line.
0 commit comments