Writing criteria for this guide
Every "for Mere Mortals" guide is written to the same nine-point standard, so a reader who trusts one can trust the rest. Here it is, with the verification notes for this particular guide below.
- Fix it first. Reader outcomes lead, not action items: each chapter opens by naming the outcome it delivers, shows a check the reader can run to confirm they got it, and a reasonable reader finishes able to state what was done, what it means, and what to try next.
- Plain language. Short sentences, everyday vocabulary, technical terms defined on first use. No slang, and no idioms that only make sense in one country — the reader may be translating as they go.
- No dead ends. A guide never tells the reader to do something it cannot show them how to verify. Every claim a reader relies on — an install, a command, an output — is something this guide demonstrates or clearly labels documented-only below.
- Live-verified where it matters. Procedures are run for real in the guide's lab wherever the build machine allows it, and the transcripts kept in the repository are the evidence. What could not be run is listed honestly below, never presented as if it had been.
- General audiences. Nothing in this guide — examples, fixtures, names, addresses — is modelled on any particular reader or author's real life, network, or organisations. The lab's traffic is the lab talking to itself.
- Standalone. A reader needs this guide, its lab, and nothing else. Where another guide would genuinely help, it is pointed to once, by name, and the chapter still completes without it.
- Honest about limits. Chapter 13 names what the tool
cannot do: detection that believes names and never reads
content (an executable renamed
.pycounted as 94 lines of Python); prose structurally counted as comments; embedded lines partitioned under one host language and double-counted under another; a counter of syntax that knows nothing of sense, quality or duplication; an answer that depends on the folder's state and the folder you stand in; and this build's own edges — one output format where more are documented, and an-ioption that never changed a table. - The one rule is in the text, early. Chapter 1 and the README state the rule plainly — a line count is an answer to a definition — before any procedure depends on it, and later chapters point back to it where a number could be mistaken for a fact of nature: the docstring that is code by one definition and documentation by another, the totals that move when only the filters moved, the claim that dissolved under a pinned definition.
- Builds clean. The site builds with MkDocs in strict mode with no warnings, and a fresh reader following the chapters in order reaches the stated outcome of each.
Verification notes for this guide
The build machine is a 2-CPU, 7.7 GB Ubuntu 24.04 sandbox.
tokei 15.0.0 ("compiled with serialization support:
json") was built from the project's own source with
cargo install tokei --locked; the machine's packaged
Rust 1.75.0 refused the crate (the edition2024 error
quoted in chapter 3), so the toolchain came from rustup —
rustc 1.99.1 — and the build took just under five
minutes. (A first compile attempt that overlapped a
second one failed on a corrupted intermediate artifact;
the shipped numbers all come from the clean single build
and from runs made after it.) The fixtures are the lab's
own, in tokei-lab/fixtures/, each counted by hand
before tokei saw it; the hand counts are recorded in
examples/lab-notes.txt and every transcript was checked
against them. All transcripts live in
tokei-lab/transcripts/.
Run for real, with transcripts as evidence:
- Version (with its formats line), the Rust version it
was built with, and the full
--help(t00). - The first count: the three-file basics tree as a table and per-file, matching the hand counts — C 6/3/1, Python 5/2/3, Markdown prose as comments with its fenced line split out as an embedded Python child (t01).
- The traps: Python docstrings counted as code, empty
line inside the string included (6 code, 0 comments);
Rust nested block comments held open to the third
line; Rust doc comments reported as embedded Markdown;
a web page split into HTML, CSS and JavaScript with a
(Total) of 16 for 12 physical lines;
--compactfolding the children away without changing a total (t02). - Detection:
MakefileandDockerfileclaimed by filename, an extensionless script claimed by its shebang (which itself counted as a comment), a.txtcounted as Plain Text prose, an unknown extension skipped in silence and then named by-v(t03). - The filters over an unchanging tree:
--hiddenadmitting a dotfile (4 lines become 6),-eremoving a named file, a.tokeignoresilencing its file and--no-ignore-dotrestoring it (t04, t05). - The
.gitignoreexperiment: inert in a plain folder, effective aftergit init, suspended by--no-ignore-vcs; the throwaway.gitwas removed after the transcript (t05). - Configuration:
notes.pyat 6 code from the guide root and 1 code / 5 comments from inside the config folder (treat_doc_strings_as_comments); atypesline appended, leaving only the Rust file standing, and the file then restored (t06). The config file itself was counted as TOML (1 code, 1 comment). - Formats: the JSON document produced and parsed by a
second program — top-level sums give 11 code where the
Total says 12, the difference traced to a report's
blobs;--streaming simpleper-file records; the-o yamlrefusal quoted in full;-n commason a large tree (t07, t08). - The
-ioption, tested four ways (file argument and standard input, empty folder and populated one, once more with--files): it never changed a table, and from an empty folder printed zeros rather than the saved counts (t07). The transcript was regenerated after its first capture counted this guide's own still-growing transcript files. - Sorting (
--sort codereorders the basics table) and the types filter (-t Pythonisolates one row) (t08). - The claim:
wc -lreporting 19 (and 0 for the newline-less file) against tokei's 20 lines and 6 code over the same rigged tree (t09). - The map and the speed: 334 language rows in
--languages; tokei counting its own source folder — 23 files, 7,735 lines, 6,059 code — in 0.022 s of real time (t10). - The limits exhibit, run in scratch and not shipped as
a fixture: a copy of
/bin/truerenamedfake.py, counted as 94 lines of Python code (t90).
Documented only — described from the project's
documentation, source or --help text, not run, and the
text does not claim otherwise:
- The configuration file's full search order (config
folder, home folder, current folder) and its remaining
keys (
columns,hidden, theno_ignorefamily,sort), read from the project's configuration definition. The two keys chapters 7 and 10 rely on —treat_doc_strings_as_commentsandtypes— were run and are in the transcripts above. - The extra output formats (YAML, CBOR and friends) and
the
--featuresbuilds that enable them: the lab's build has JSON only, and its refusal to write YAML is the transcript's evidence. - Installation routes other than the lab's own: package managers, older release binaries (the project's releases carry binaries only up to 12.1.2 — checked against the releases list), and the Windows and macOS wrappings of the cargo route.
- The neighbouring tools in chapter 12 are characterised,
not benchmarked —
wcexcepted, which chapter 11 runs head-to-head. --columns,--rsortand the JSON variant of--streamingare named from the help text; the table-shaping runs in the transcripts use--sort,-t,-nand--streaming simple.
Fixtures are this guide's own and deliberately generic: a greeter, a C hello-world with a banner comment, shelf notes, a self-counting counter, a pretend container recipe, a label printer with an oversized banner, and one file with no newline at the end. No example is modelled on any real person, network, service or organisation.