effort

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 3 Imported by: 0

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 Default

func Default() Scale

Default returns the built-in vocabulary: small, medium, large.

func NewScale

func NewScale(values []string) (Scale, error)

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) Contains

func (s Scale) Contains(v string) bool

Contains reports whether v is part of the vocabulary.

func (Scale) Highest

func (s Scale) Highest() string

Highest returns the highest value in the vocabulary.

func (Scale) Len

func (s Scale) Len() int

Len returns the number of values in the vocabulary.

func (Scale) Lowest

func (s Scale) Lowest() string

Lowest returns the lowest value in the vocabulary — the one that counts as a quick win.

func (Scale) Points

func (s Scale) Points(v string, maxPoints int) (int, bool)

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

func (s Scale) Rank(v string) int

Rank returns the position of v in the vocabulary (0 is lowest), or -1 when v is not part of it.

func (Scale) String

func (s Scale) String() string

String renders the vocabulary as a comma-separated list, for use in error messages and help text.

func (Scale) Values

func (s Scale) Values() []string

Values returns the vocabulary, lowest to highest.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL