validate

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 6 Imported by: 0 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 validate provides JSONL validation against the bd import schema. It checks each line of a JSONL file for required fields, valid types, and correct formats, producing detailed error messages with fix suggestions.

Index

Constants

This section is empty.

Variables

View Source
var ValidStatuses = []string{"open", "closed"}

ValidStatuses are the allowed values for the "status" field in a bead record.

View Source
var ValidTypes = []string{"bug", "task", "chore", "epic", "feature"}

ValidTypes are the allowed values for the "type" field in a bead record.

Functions

This section is empty.

Types

type Result

type Result struct {
	TotalLines int
	Errors     []ValidationError
}

Result contains the outcome of validating a JSONL file.

func Validate

func Validate(r io.Reader) *Result

Validate reads JSONL from r and validates each line against the bd import schema. It returns a Result with all validation errors found.

func (*Result) Valid

func (r *Result) Valid() bool

Valid returns true if no errors were found.

type ValidationError

type ValidationError struct {
	Line       int    // 1-based line number
	Field      string // field name (empty if line-level error)
	Message    string // what's wrong
	Suggestion string // how to fix it
}

ValidationError represents a single validation issue on a specific line.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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