config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package config handles Runefile discovery and settings resolution.

Index

Constants

View Source
const CurrentVersion = "1"

CurrentVersion is the Runefile semantics version this build implements. Breaking changes are opt-in per file via `set rune_version := "..."`; the default interpretation never changes under a user (FR-033).

Variables

View Source
var ErrNotFound = errors.New("no Runefile found in this directory or any parent")

ErrNotFound is returned when no Runefile can be located by upward discovery.

Functions

func Compatible

func Compatible(f *ast.File) bool

Compatible reports whether this build can interpret the file's declared version. An empty pragma (the common case) is always compatible and uses the default interpretation.

func Compose

func Compose(f *ast.File, src diag.SourceProvider) diag.List

Compose resolves a file's imports (spliced into the same namespace) and mods (loaded as child namespaces addressable as name::task). It mutates f in place and returns any diagnostics (including reported name collisions, FR-011).

func Discover

func Discover(startDir string) (string, error)

Discover walks startDir and its ancestors, returning the absolute path of the nearest Runefile / .runefile (case-insensitive). It returns ErrNotFound if none exists up to the filesystem root.

func Resolve

func Resolve(fileFlag, startDir string) (string, error)

Resolve picks the Runefile to use. If fileFlag is non-empty it is used directly (and must exist); otherwise discovery walks up from startDir.

func RuneVersion

func RuneVersion(f *ast.File) string

RuneVersion returns the version pragma declared by a file, or "" if none.

Types

type Settings

type Settings struct {
	Default    string   // set default := "task"
	WorkingDir string   // set working-directory := "path"
	Quiet      bool     // set quiet
	Export     bool     // set export (export all variables to the task env)
	Fallback   bool     // set fallback
	Dotenv     string   // set dotenv := ".env"
	Shell      []string // set shell := ["bash", "-cu"]
	Python     []string // set python := ["python3"]
	Node       []string // set node := ["node"]
	AgentCmd   []string // set agent_cmd := ["claude", "-p"]
}

Settings holds the resolved module settings that influence execution.

func ResolveSettings

func ResolveSettings(f *ast.File, ev *eval.Evaluator) (Settings, diag.List)

ResolveSettings evaluates a file's settings into a Settings value. String and list settings are evaluated with ev; boolean settings use their bare form.

Jump to

Keyboard shortcuts

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