Skip to content

Remove the punctuation dash from what the tool prints, and release 0.3.0 - #5

Merged
Waiga merged 2 commits into
mainfrom
fix/no-dashes-in-output
Sep 20, 2026
Merged

Waiga merged 2 commits into
mainfrom
fix/no-dashes-in-output

Conversation

@Waiga

@Waiga Waiga commented Sep 20, 2026

Copy link
Copy Markdown
Owner

What this changes

One line of what the tool prints, plus the release that carries it to the index.

The report header read Show Your Work followed by an em dash and the file path.
That em dash was the only punctuation dash reaching a reader in an ordinary run.
It now reads:

Show Your Work: examples/messy-forecast.xlsx

The colon is the shape before-you-send 0.3.0 settled on for the same header
problem, so the four public tools now open a report the same way.

Why output and not just prose

The dash ban is Waiga's standing instruction from 10 September 2026. Asked on 18
September whether it reaches what a program prints and not only what a person
writes, the answer was yes. A command's output is published the moment somebody
runs it, and it is quoted into tickets and chat far more often than a README is
read.

How the count was made, and why one is a floor rather than a total

A sister repository was audited for the em dash and came back with nine sites.
A second pass found five more, because the ASCII sequence of a space, two
hyphens and a space prints identically to an em dash and matches no search for
one. The real total was fourteen. The same search had reported one site here, so
it was redone from scratch:

  • Every module read as a syntax tree, not as text. That separates a string that
    can be printed from a comment or a docstring that cannot, and it holds across
    Python versions in a way that tokenising an f-string does not.
  • Six dash characters counted one at a time: em, en, figure, horizontal bar,
    minus sign, non-breaking hyphen.
  • The space-hyphen-hyphen-space sequence counted separately and explicitly.
  • JSON output parsed before scanning, because json.dumps escapes a non-ASCII
    character by default, so an em dash leaves the program as six ASCII characters
    and a search of the raw text would find nothing.

Result: one printable dash in the source, in show_your_work/report.py. It is
gone. Four dashes remain in comments and docstrings and were deliberately left
alone, because nothing prints them, and changing them would have been noise in
this diff.

What was deliberately kept

Two things read as a dash and are not punctuation:

  • The rule of repeated hyphens under each heading. That is a horizontal line.
  • The hyphen opening each item of the NOT CHECKED list. That is a bullet
    marker, exactly as in Markdown.

Hyphens inside compound words and identifiers are spelling and were not touched:
Macro-enabled workbook (.xlsm), --show-values, non-zero, and the
Open Government Licence – Ontario en dash in the corpus manifest, which is the
licence's own registered name.

The test

tests/test_output_style.py, 24 cases, guards both directions.

One half runs every invocation the README documents, over eight workbooks:
text, --verbose, --show-values, both together, --format json single and
array, several files in one run, --help, --version, and the two refusal
messages on stderr. It reads what a person would actually see.

The other half reads the source, so a dash typed into a check message that no
fixture here happens to trigger still fails the build. Without it the suite
would only prove the paths it exercises.

Each half was proved by putting a dash back:

Reintroduced Caught by
em dash in the report header 11 cases, both halves
space-hyphen-hyphen-space in the macro_enabled summary, which no fixture triggers the source half only, exactly as designed
en dash in an argparse help string the help case and the source half

Restored after each, suite green.

Proving the negative

Every documented format option, run against both example workbooks and one
missing file, scanned for all eight dash forms:

EM DASH U+2014: 0
EN DASH U+2013: 0
FIGURE DASH U+2012: 0
HORIZONTAL BAR U+2015: 0
MINUS SIGN U+2212: 0
NON-BREAKING HYPHEN U+2011: 0
SPACED DOUBLE HYPHEN: 0
SPACED HYPHEN: 0

Excluded as syntax and reported separately:
  rule line of repeated hyphens or equals signs: 48
  line-start bullet marker: 48

README

The sample block is regenerated from a real run rather than edited by hand. That
surfaced a second drift nobody had noticed: two of its finding lines carried
three spaces before the check name where the tool prints two, so the published
sample was not output this tool had ever produced. The block is now byte for
byte what the command emits.

The documented reproduce sequence still holds after the change:

python examples/make_examples.py
show-your-work examples/messy-forecast.xlsx   # 7 findings, exit 1
show-your-work examples/clean-forecast.xlsx   # nothing found, exit 0

Release

Version 0.3.0 in pyproject.toml, a minor bump because what the tool prints
changed. The version has one home and is read from installed metadata, so
nothing else needed editing. The pre-commit revision example in the README moves
with it, and the copy of that example inside .pre-commit-hooks.yaml was still
pinned at v0.1.0, two releases stale; it is now current.

Repository name and package name still differ on purpose. The package is
unexplained-cells, the command is show-your-work, and the console entry
point was verified to install under that name after the bump.

Tests

62 before, 86 after, 24 of them new. Green on Python 3.9.6, 3.11.16, 3.13.2 and
3.14.7 locally. ruff check . clean.

Not merged, not tagged, not published.

🤖 Generated with Claude Code

Waiga and others added 2 commits September 20, 2026 13:34
The report header put an em dash between the tool name and the file path. That
was the only punctuation dash reaching a reader in an ordinary run, and the dash
is banned in anything published under Waiga Arya's name. Program output is
published the moment somebody runs the command, so the rule reaches it too. The
header now reads "Show Your Work: path", the same shape before-you-send 0.3.0
settled on.

What was searched, so the count can be trusted. Every module was read as a
syntax tree rather than as text, which separates a string that can be printed
from a comment or a docstring that cannot. Each of the six dash characters was
counted separately, and the ASCII sequence of a space, two hyphens and a space
was counted on its own, because it prints identically to an em dash while hiding
from a search for one. That is the mistake that undercounted a sister repository
by five sites. Here the source held one printable dash and it is gone. The
dashes remaining in comments and docstrings were left alone: nothing prints them.

Two things stay, and they are layout rather than punctuation. A line of repeated
hyphens is the rule under a heading. The hyphen that opens each item of the "Not
checked" list is a bullet marker, the same way it is in Markdown.

tests/test_output_style.py guards both directions. One test runs every format
the README documents, over eight workbooks, and reads what a person would
actually see, including the JSON path, where an escaped unicode dash would slip
past a search of the raw text. The other reads the source, so a dash typed into
a message no fixture happens to trigger still fails. Each was proved by putting
a dash back and watching the right test break.

The README sample block is regenerated from a real run, not typed. That
corrected a second drift nobody had noticed: two of its finding lines carried
three spaces before the check name where the tool prints two, so the published
sample was not output the tool had ever produced. The documented reproduce
sequence still holds, messy exits 1 with 7 findings and clean exits 0.

Version 0.3.0, a minor bump because what the tool prints changed. The pre-commit
revision example in the README moves with it, and the same example inside
.pre-commit-hooks.yaml was still pinned at v0.1.0, two releases stale.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The block announces seven findings and then shows three, ending without
saying so. A reader has no way to tell the output stopped rather than
finished. The companion fix in says-on-the-tin names its omitted sections
in prose outside the fence; this does the same.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Waiga
Waiga merged commit 3ea1541 into main Sep 20, 2026
9 checks passed
@Waiga
Waiga deleted the fix/no-dashes-in-output branch September 20, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant