passsy / dartdoc-commentsr3
Dartdoc Comments for Public APIs
PublicWrite short dartdoc for public APIs that explains usage, context and non-obvious behavior, and never restates what the name already says.
tests, run by the registry4 passed · slowest 6.3 ms
✓fires6.3 ms
points at the principle when the user asks for a doc comment
prompt · in fixtures/dart_appfired: "doc comment"
write a doc comment for this class✓fires4.4 ms
points at the principle when the user mentions dartdoc
prompt · in fixtures/dart_appfired: "dartdoc"
Run dartdoc and fix the warnings✓quiet3.1 ms
stays quiet on the same words outside a Dart project
promptstayed quiet
write a doc comment for this class✓quiet6.1 ms
stays quiet on a prompt about something else
prompt · in fixtures/dart_appstayed quiet
Rename the Plain class to Simpledetector.test.tseach detect() call runs the real detectorEdit
import { expect, test } from "vitest";
import { detect, prompt } from "@wellactually/sdk/v3/test";
const dartApp = { project: "fixtures/dart_app" };
test("points at the principle when the user asks for a doc comment", () => {
expect(detect(prompt("write a doc comment for this class"), dartApp)).toEqual([{ match: "doc comment", depth: "pointer" }]);
});
test("points at the principle when the user mentions dartdoc", () => {
expect(detect(prompt("Run dartdoc and fix the warnings"), dartApp)).toEqual([{ match: "dartdoc", depth: "pointer" }]);
});
test("stays quiet on the same words outside a Dart project", () => {
expect(detect(prompt("write a doc comment for this class"))).toEqual([]);
});
test("stays quiet on a prompt about something else", () => {
expect(detect(prompt("Rename the Plain class to Simple"), dartApp)).toEqual([]);
});