rehlma / docs-reviewable-proser1
Keep prose diffs at one sentence per line
PublicWrite one prose sentence per source line and apply the convention only to text being edited.
tests, run by the registry3 passed · slowest 1.3 ms
✓fires1.0 ms
reports two prose sentences on one written line
write docs/design.mdfired: line 1
The store owns state. The view observes it.✓quiet1.2 ms
allows separate sentences and common non-prose forms
write docs/design.mdstayed quiet
The store owns state.
The view observes it.write docs/design.mdstayed quiet
Title. Subtitlewrite docs/design.mdstayed quiet
| A. B | C |write docs/design.mdstayed quiet
mermaid
A. Bad example
write docs/design.mdstayed quiet
Use Store. Value here.write docs/design.mdstayed quiet
Use e.g. Store methods.✓quiet1.3 ms
ignores legacy paragraphs and files outside docs
write docs/design.md · wrote line 2stayed quiet
One sentence. Another sentence.
New paragraph.write CHANGELOG.mdno handler of the detector wants this event
One sentence. Another sentence.detector.test.tseach detect() call runs the real detector
import { expect, test } from 'vitest';
import { detect, write, edit, read, command, output, prompt } from '@wellactually/sdk/v3/test';
const flutter = { project: 'fixtures/flutter' };
const dart = { project: 'fixtures/dart' };
test('reports two prose sentences on one written line', () => {
expect(detect(write('docs/design.md', 'The store owns state. The view observes it.'))).toEqual([{ line: 1 }]);
});
test('allows separate sentences and common non-prose forms', () => {
for (const text of ['The store owns state.\nThe view observes it.', '# Title. Subtitle', '| A. B | C |', '```mermaid\nA. Bad example\n```', 'Use `Store. Value` here.', 'Use e.g. Store methods.']) {
expect(detect(write('docs/design.md', text))).toEqual([]);
}
});
test('ignores legacy paragraphs and files outside docs', () => {
expect(detect(edit('docs/design.md', 'One sentence. Another sentence.\nNew paragraph.', { written: 'New paragraph.' }))).toEqual([]);
expect(detect(write('CHANGELOG.md', 'One sentence. Another sentence.'))).toEqual([]);
});