Documentation
¶
Overview ¶
Package work reads and moves work items kept as files in .workline/work/, for projects without a forge (docs/spec/routing.md, "Work starts from a clear need").
Index ¶
- Constants
- Variables
- func Break(line string) bool
- func ByMeaning(body string) map[Meaning]Section
- func Footer(body string) (string, string)
- func Has(names []string, m Meaning) bool
- func Heading(line string) (string, bool)
- func Name(m Meaning) string
- func Path(repo, id string) string
- func Ready(repo, id string) *verdict.Verdict
- func ReadyOnForge(f forge.Forge, id int) *verdict.Verdict
- func Sections(content string) map[string]string
- func WithFooter(main, footer string) string
- type Meaning
- type Row
- type Section
- type Table
- func (t Table) Builder(m Meaning) bool
- func (t Table) In(names []string, m Meaning) (string, bool)
- func (t Table) Meaning(heading string) Meaning
- func (t Table) Meanings() []Meaning
- func (t Table) Name(m Meaning) string
- func (t Table) Of(m Meaning) []string
- func (t Table) Read(body string) map[Meaning]Section
- func (t Table) With(m Meaning, written string) Table
Constants ¶
const NoResponse = "_No response_"
NoResponse is what an issue form writes for a field left empty.
Variables ¶
var Headings = Table{ {Meaning: Need, Headings: []string{"Need"}}, {Meaning: Example, Headings: []string{"Example"}}, {Meaning: Steps, Headings: []string{"Steps to reproduce"}}, {Meaning: Validation, Headings: []string{"Validation"}}, {Meaning: Verification, Headings: []string{"Verification"}, Builder: true}, {Meaning: Scope, Headings: []string{"Scope"}, Builder: true}, }
Headings is the table the engine reads and writes issues with. A heading never leaves it: issues were written under it.
var Required = []Meaning{Need, Verification, Validation, Scope}
Required are the meanings an item needs before it is ready, in the order a check says what is missing.
Functions ¶
func Break ¶ added in v0.23.0
Break says whether a line is a thematic break: `---`, `***` or `___`, CommonMark's.
func ByMeaning ¶ added in v0.23.0
ByMeaning is a body's sections by meaning, read with the engine's table.
func Footer ¶ added in v0.23.0
Footer splits a body from its footer, which belongs to no section (docs/spec/backlog-acts.md, "A body's footer"): from a thematic break (`---`, `***`, `___`, a blank line above it) after the last heading, or else the body's last line when it is a tool's signature alone in its paragraph ("🤖 Generated with …", "Generated by …"). It returns the body without it, its trailing blank lines too, and the footer, "" when there is none.
func Ready ¶
Ready moves an item to ready if its four sections are written, and says which are missing otherwise. It checks presence, not quality: that is the person's call.
func ReadyOnForge ¶
ReadyOnForge is Ready for an issue on a forge: the sections are read from its description, and a ready issue gets the workline:ready label.
func Sections ¶
Sections returns the text under each "## " or "### " heading — an issue form writes its fields as the latter. A field left empty in a form ("_No response_") is empty. A heading written twice holds the text under both, the first one's first. A thematic break ending a section — the line between the person's part of an issue and the builder's — is not its text.
func WithFooter ¶ added in v0.23.0
WithFooter is a body rewritten without its footer, the footer put back after it: a section added goes above it.
Types ¶
type Meaning ¶ added in v0.23.0
type Meaning string
Meaning is what a section of an issue says, whatever heading it is under. Its id is the key a refine gives the section, and never changes.
type Row ¶ added in v0.23.0
Row is a meaning and its headings, the first the one written. A builder's section is below the line between the person's part of an issue and the builder's; above it, a person's, which the role drafts for a person to make theirs.
type Section ¶ added in v0.23.0
Section is a body's section read by its meaning: the heading it is under there, the first when several hold it, and the text under all of them.
type Table ¶ added in v0.23.0
type Table []Row
Table holds each meaning once, in the order the role writes an issue's sections in, for its reader: the person's part — the need, a real example of it or a bug's steps to reproduce, how a person accepts it — then the builder's — how the machine proves it, the code it touches.
func (Table) Builder ¶ added in v0.23.0
Builder says whether a meaning's section is the builder's, below the line.
func (Table) In ¶ added in v0.23.0
In is the first of names, headings, that names meaning m; ok is false when none does.
func (Table) Meaning ¶ added in v0.23.0
Meaning is the meaning a heading names; "" when it names none.
func (Table) Meanings ¶ added in v0.23.0
Meanings are the table's meanings, in the order the role writes them.
func (Table) Of ¶ added in v0.23.0
Of are the headings a meaning is read under, the one written first.