Documentation
¶
Overview ¶
Package effort models the project's effort vocabulary: the ordered set of values the effort frontmatter field may take.
The vocabulary is ordinal — values are ordered lowest to highest — which is what lets filters compare (effort>small), boards and lists sort, and next score smaller work more highly. Projects override it via the effort key in .taskmd.yaml; when unset the default small, medium, large applies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scale ¶
type Scale struct {
// contains filtered or unexported fields
}
Scale is an ordered effort vocabulary, lowest value first.
The zero value is usable and behaves as the default vocabulary, so callers with no configuration can pass Scale{} safely.
func NewScale ¶
NewScale returns a Scale over values, ordered lowest to highest.
It rejects an empty list, blank entries, and duplicates — each of which would otherwise produce a vocabulary that cannot be validated or ordered sensibly.
func (Scale) Lowest ¶
Lowest returns the lowest value in the vocabulary — the one that counts as a quick win.
func (Scale) Points ¶
Points scores v proportionally to its position: the lowest value earns maxPoints, the highest earns none, and the values between are spread evenly. For the default three-value vocabulary and maxPoints=5 this yields 5, 2, 0.
The bool is false when v contributes no points — because it is unset, unknown to the vocabulary, or the highest value.
func (Scale) Rank ¶
Rank returns the position of v in the vocabulary (0 is lowest), or -1 when v is not part of it.