Skip to content

hooks: lint the prose git never sees - #29

Merged
aberoham merged 1 commit into
NicTool:mainfrom
aberoham:prose-linter
Aug 30, 2026
Merged

aberoham merged 1 commit into
NicTool:mainfrom
aberoham:prose-linter

Conversation

@aberoham

Copy link
Copy Markdown
Collaborator

The hook checks diffs and commit messages. Git never sees a PR or issue body, so nothing checked the writing that gets read the most. That is how One wart, kept on purpose reached a review draft.

--prose FILE runs the same script over a draft before it is posted:

$ python3 hooks/check.py --prose draft.md
note: line 1: trailing ', and the' clause; start a new sentence
line 1: 'sat behind'; say it plainly
line 5: 'wart'; say it plainly
line 5: 'quietly'; say it plainly
exit: 1

Hard failures are figurative filler, a semicolon, a sign-off or generated-by trailer, the word list, and any sentence over thirty words. Everything else is a note and never fails the run.

The semicolon rule is not a style preference. Matt's own prose does not use one. Across 937 lines of his commit messages and both corpus files in local/, every semicolon is either pasted code or a ;-) wink. The rule allows the wink.

Hedges and modals are never flagged. A linter that squeezed them out would rewrite claims. That idea and two others come from danyuchn/asd-ste100-skill#5. The others are splitting hard failures from advisory notes, and stripping fenced and inline code before matching.

Run against the six PR bodies drafted this week, it failed one that was already posted. It flagged the same trailing-clause habit in four of the others.

82 tests pass. uvx ruff check . is clean.

@aberoham
aberoham merged commit ee92aae into NicTool:main Aug 30, 2026
1 check passed
aberoham added a commit that referenced this pull request Aug 30, 2026
The prose mode shipped in #29 missed two habits a reviewer named the
same day. Work pushed out of the change, and telling the reader what
they already know. Both are now hard failures.

```
$ python3 hooks/check.py --prose draft.md
line 1: 'is a separate decision'; do the work or say nothing
line 2: 'Obviously'; the reader already knows
line 3: 'worth noting'; do the work or say nothing
line 4: 'left as future work'; do the work or say nothing
exit: 1
```

A plain statement of fact still passes. `The api is the only consumer of
these schemas` is clean.

85 tests pass.
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