docket-ship
Contents

What check verifies

Every rule docket-ship check applies, with its level, from docket-ship's own spec.

Every rule docket-ship check applies, with its level. Errors fail the run; warnings fail it only with --strict. This page is docket-ship's own spec for the checker, and the ids in brackets link to the decisions behind each rule.

Output is one path:line: level: message per issue. The exit code is 1 on any error, or on any warning with --strict. Implemented in check in check.rs.

Headers and ids

Rule Level
Header present, closed, and every line parses as key: value or key: [a, b] error
Required keys per type are present (a decision's date may be empty); status is valid error
A decision's date is YYYY-MM-DD, YYYY-MM, YYYY or empty; recorded, when set, is YYYY-MM-DD, and date does not fall after it at its own precision [D-0022] error
type matches the folder; ids match the type's pattern; ids are unique error
A spec id equals its filename; a decision or ticket filename starts with its id error
Unknown header keys warning
Rule Level
affects, supersedes, specs, decisions, blocked_by and tickets name docs that exist, of the right kind error
superseded ⇔ superseded_by is set, and both sides agree error
An accepted decision's supersedes targets are marked superseded by it error
A spec cites a superseded or rejected decision error
A spec cites a proposed decision warning
An accepted decision is not cited in a spec it affects warning
A spec cites a ticket warning
A cited id (outside backticks) doesn't exist; a relative markdown link doesn't resolve error
An open ticket implements a retired spec warning

Ticket fields [D-0014]

The optional assignee, priority and labels keys are described in the ticket-fields spec.

Rule Level
assignee is not in people in docket-ship.cfg; the message names the key to add it to error
priority is not urgent, high, normal or low error
A label or a people name is not lowercase letters, digits and hyphens error
A label is a near-duplicate of another label in use; the message names the other label and its count warning

Spec prose [D-0004]

These run on specs only, skip fenced code, and skip lines marked docket-ship:ignore.

Rule Level
A phrase from history_phrases in docket-ship.cfg (status or history wording) warning
A backticked path (with a / and an extension) that isn't in the project or the code roots warning
A backticked camelCase, PascalCase or snake_case name that doesn't appear in any code file warning

The code-reference warnings say so when the spec has open tickets, since the code may simply not be built yet. Symbols are only checked when code is set and symbols: true. See is_distinctive for which names count.

References from code

These run when code is set, on the comments in the code roots only, since string literals hold test data. comments in comments.rs finds them by each extension's markers (// and /* */, #, <!-- -->, --) at the start of a line or after a space or bracket; files without comment syntax, such as JSON, are skipped. As in docs, ids and paths in backticks are examples, and lines marked docket-ship:ignore are skipped.

Rule Level
A D-NNNN or T-NNNN in a code comment names no doc error
A path to a .md file under the docs folder in a code comment doesn't exist, from the project root or, with ../, from the code file error
A code comment cites a superseded or rejected decision warning

Frozen decisions [D-0001]

Rule Level
A decision that was accepted or superseded at the last commit has changed since, other than its status and superseded_by; reported at the first changed line warning

Only docket-ship check on the command line runs this rule, since it needs git: GitHistory in git.rs lists the docs changed since HEAD (staged or not) and reads HEAD's copy of each, and check_frozen compares them through the core's History trait. Without git, outside a repository or before the first commit it is skipped without a message. The export and the WebAssembly build leave it out, so they report the same issues wherever they run.

The project root [D-0017]

The tool reads and checks only files inside the project root, the folder holding docket-ship.cfg, so a repo's own config or docs cannot make it read anything else, such as the dashboard server's files. A path is outside when it is absolute or its .. parts climb above the root; .. that stays inside is resolved (docs/../cli/Cargo.toml is cli/Cargo.toml).

Rule Level
docs in docket-ship.cfg is outside the root; the default docs folder is used instead error
A code folder in docket-ship.cfg is outside the root; it is not read error
A relative markdown link or a backticked path outside the root counts as missing (the link and path rules above), without the file interface being asked about it as above

Project::load in project.rs resolves the config's folders and inside_exists in check.rs the paths in doc bodies, both with paths::inside_root.

Generated and copied files [D-0005]

Rule Level
docs/INDEX.md matches what docket-ship index would write error
docs/CONVENTIONS.md is present and matches the tool's copy warning

Edit this page on GitHub