scanner

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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