taskfile

package
v0.0.0-...-5f22abe Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 4 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeNewTags

func ComputeNewTags(current, addTags, removeTags []string) []string

ComputeNewTags computes the resulting tag list after additions and removals.

func FindFrontmatterBounds

func FindFrontmatterBounds(lines []string) (int, int)

FindFrontmatterBounds returns the line indices of the opening and closing "---" delimiters.

func FormatInlineList

func FormatInlineList(fieldName string, values []string) string

FormatInlineList formats a named list field as inline YAML: field: ["a", "b"]

func FormatInlineTags

func FormatInlineTags(tags []string) string

FormatInlineTags formats tags as inline YAML: tags: ["a", "b"]

func ReplaceID

func ReplaceID(filePath, newID string) error

ReplaceID rewrites the id field in a task file's frontmatter.

func ReplaceReference

func ReplaceReference(filePath, oldID, newID string) error

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".

Jump to

Keyboard shortcuts

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