Repository navigation
Conversation
tony
force-pushed
the
example-style
branch
7 times, most recently
from
October 4, 2026 16:50
fe92448 to
d332095
Compare
tony
force-pushed
the
example-style
branch
4 times, most recently
from
October 4, 2026 23:18
7befbfe to
0b0dd91
Compare
tony
force-pushed
the
example-style
branch
3 times, most recently
from
October 5, 2026 05:56
25929a5 to
e9a2b57
Compare
tony
force-pushed
the
example-style
branch
2 times, most recently
from
October 11, 2026 02:16
4b395a1 to
91252e7
Compare
tony
force-pushed
the
example-style
branch
8 times, most recently
from
October 11, 2026 06:22
ec0c318 to
0bc1ca9
Compare
why: Example width and shape were unwritten, so each example was formatted by whatever its tool did. The shared section states the rule; the repository block names StyLua and the check. what: - Add `## Examples` after `## Markdown and code blocks`, byte-identical to the shared section in libtmux/docs#101 - Add a `### Code blocks` heading so the shared section's `#code-blocks` link resolves; this file's own heading is the longer `## Markdown and code blocks` - Add `### In this repository`: the StyLua config and the width check, the surfaces StyLua skips, which examples run, and the copies that have no sync tool - Show the README split line as Bad and its named-option form as Good
why: An agent adding an example has no reason to open WRITING.md, where the width rule now lives. what: - Add "any code example (example programs, Markdown code blocks)" to the WRITING.md routing line and link its Examples section
why: Nothing stopped a README fence or an example from growing past 80 columns. StyLua treats `column_width` as a guide rather than a limit and does not wrap comments, and it never sees Markdown, so a check has to read both. A new file under examples/ would also go unread unless something forces a decision about it. A libtmux.org code block holds 78 columns at 1024 px (Firefox, WebKit, CI's Chrome) and 99 at 1440 px (Firefox, WebKit); libtmux/docs#101 sizes the code font so 80 columns fit from 1024 px up. what: - Add scripts/check_example_width.py, the shared checker, and .github/example-width.toml naming the Markdown and example files - Add the `width` gate to scripts/check.py: it runs the checker's --self-test, then the check, inside `mid` - Document the command in CONTRIBUTING.md beside the other gates - Check every `**/*.md` page with no exclusions, so WRITING.md and AGENTS.md, which CLAUDE.md links to, are held to the width too - Check every Lua program under examples/ and the launcher examples/api/run.sh as `sources`, since a reader opens and copies them - Require every tracked file under examples/ to be checked or excluded with a reason: exclude examples/api/manifest.json (a machine-read index whose JSON strings cannot wrap) and examples/stylua.toml - Check that examples/stylua.toml equals stylua.toml except for `column_width`, through a `[[formatter_copies]]` entry - Point a wide line at Reaching 80, and a wide console command at its shell's continuation - Allow one line, with a reason: the Bad example in WRITING.md's port block, which shows the width problem the Good example fixes; allow_ceiling equals that one entry - Record shared_digest, the --digest of WRITING.md's shared section, so a local edit to it fails the check - Record checker_digest, the --digest of this checker, so a local edit to it fails until every port changes together
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
examples/at 80; the rest of the source keeps 100.luafence in the README and docs (none ran).Merge after libtmux/docs#101 deploys: it makes 80 columns fit a libtmux.org code block from 1024 px up.
What changed
Policy
.github/WRITING.mdgains an## Examplessection after## Markdown and code blocks(now with a### Code blocksheading the shared text links to). The existing example-shape rules stay under## Documentation and examples. The "In this repository" block names StyLua,stylua.toml,examples/stylua.toml, and the<!-- lua: ... -->fence classes.AGENTS.mdroutes code examples to it.Tooling
examples/stylua.tomlis a copy of the root config withcolumn_width = 80. StyLua starts in the directory of the file being formatted and searches upward, so the existingstylua --checkneeds no new flags. A[[formatter_copies]]entry fails the check if the copy differs from the root in anything butcolumn_width.scripts/check_example_width.pyand.github/example-width.tomlread every**/*.mdpage,examples/**/*.luaandexamples/api/run.sh. Two[[exclude]]entries, each with a reason:examples/stylua.toml, which[[formatter_copies]]already compares, andexamples/api/manifest.json, a machine-read index whose JSON strings cannot wrap. One[[allow]]entry: the deliberately wide Bad line in WRITING.md's port block. They run as thewidthgate insidescripts/check.py mid: self-test first, then the check.scripts/check_doc_fences.py(thefencesgate, outer phase): eachluafence carries<!-- lua: run | fragment | compile-only: reason -->and an unclassified fence fails. The 11 existing fences are 1 run, 7 fragments, 3 compile-only.fencesgate runs in the outer phase, notmid, because it needs a tmux 3.7c binary.Examples
examples/**/*.lua(10 Lua files, +124/-45, plus the newexamples/stylua.toml); the hand edits name session, query and split options before the call, and split two shell commands.Evidence
ci.ymlinstalls) takes the width from the nearest config (search order,column_width).column_widthguides the formatter and does not cap a line, which is why the separate width check exists.column_widthof 80, which would reflowlua/andpackages/for no reader benefit;Examples(style): Format examples at 80 columnsweighs the other options.examples/quickstart.lua: the second pass rewrites the first pass's output with identical flags and config.Examples(style[quickstart]): Name session optionshoists that chain into a local.pane:captureeindocs/panes.mdfails with "attempt to call a nil value (method 'capturee')"; the clean tree passes. The gate needsTMUX_BINat the 3.7c toolchain the repository bootstraps, because libtmux-lua does not support tmux 3.7d yet.How to verify
$ mise exec -- python scripts/check_example_width.py --self-test$ mise exec -- python scripts/check.py width$ mise exec -- python scripts/check.py formatThe fence harness needs the repository's tmux 3.7c in
TMUX_BIN.$ mise exec -- python scripts/check.py fences