Documentation
¶
Overview ¶
Package taskfile reads and updates task markdown files on disk.
It modifies YAML frontmatter fields (status, tags, dependencies, PRs) and body content while preserving the rest of the file unchanged.
Index ¶
- func ComputeNewTags(current, addTags, removeTags []string) []string
- func FindFrontmatterBounds(lines []string) (int, int)
- func FormatInlineList(fieldName string, values []string) string
- func FormatInlineTags(tags []string) string
- func ReplaceID(filePath, newID string) error
- func ReplaceReference(filePath, oldID, newID string) error
- func UpdateTaskFile(filePath string, req UpdateRequest) error
- func ValidateUpdateRequest(req UpdateRequest) []string
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeNewTags ¶
ComputeNewTags computes the resulting tag list after additions and removals.
func FindFrontmatterBounds ¶
FindFrontmatterBounds returns the line indices of the opening and closing "---" delimiters.
func FormatInlineList ¶
FormatInlineList formats a named list field as inline YAML: field: ["a", "b"]
func FormatInlineTags ¶
FormatInlineTags formats tags as inline YAML: tags: ["a", "b"]
func ReplaceReference ¶
ReplaceReference replaces occurrences of oldID with newID in dependency and parent fields within a task file's frontmatter.
func UpdateTaskFile ¶
func UpdateTaskFile(filePath string, req UpdateRequest) error
UpdateTaskFile reads a task markdown file, applies the requested changes, and writes it back.
func ValidateUpdateRequest ¶
func ValidateUpdateRequest(req UpdateRequest) []string
ValidateUpdateRequest checks enum fields and returns a list of error strings.
Types ¶
type UpdateRequest ¶
type UpdateRequest struct {
Title *string
Status *string
Priority *string
Effort *string
Type *string
Owner *string
Parent *string
Tags *[]string // replace tags entirely
AddTags []string // add to existing tags
RemTags []string // remove from existing tags
AddPRs []string // add PR URLs
RemPRs []string // remove PR URLs
AddTouches []string // add scope identifiers to touches
RemTouches []string // remove scope identifiers from touches
Dependencies *[]string // replace dependencies entirely
Body *string
}
UpdateRequest describes which fields to update. Nil pointer means "no change".