scanner

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package scanner walks directory trees to discover and parse task files.

It produces a ScanResult containing all parsed model.Task values found under a root directory, grouping tasks by their parent directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScanError

type ScanError struct {
	FilePath string
	Error    error
}

ScanError represents an error encountered during scanning

type ScanResult

type ScanResult struct {
	Tasks  []*model.Task
	Errors []ScanError
}

ScanResult contains the results of a directory scan

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner scans directories for markdown task files

func NewScanner

func NewScanner(rootDir string, verbose bool, ignoreDirs []string) *Scanner

NewScanner creates a new directory scanner. ignoreDirs specifies additional directory names to skip during scanning.

func (*Scanner) Scan

func (s *Scanner) Scan() (*ScanResult, error)

Scan walks the directory tree and finds all markdown files with task frontmatter

func (*Scanner) ScanArchive

func (s *Scanner) ScanArchive() ([]*model.Task, error)

ScanArchive walks rootDir to find directories named "archive" and parses task files within them. These tasks are returned for dependency resolution but are not included in normal scan results.

func (*Scanner) SkippedSegment added in v0.4.5

func (s *Scanner) SkippedSegment(relPath string) string

SkippedSegment reports the first segment of relPath — a directory path relative to the scanner's root — that the scanner would refuse to descend into, or "" if the whole path is scannable. Writers use it to check a destination directory against the same rules the walk applies, so a file cannot be written somewhere the scan will never look.

Segments are matched by name at any depth, matching the walk: "a/content" is skipped when "content" is ignored, just as "content" is.

Jump to

Keyboard shortcuts

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