scaffold

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package scaffold detects project type and generates cidx.toml configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDiff added in v1.7.0

func FormatDiff(diff *DiffResult) string

FormatDiff returns a human-readable representation of the diff.

func GenerateTOML

func GenerateTOML(d *Detection) string

GenerateTOML produces a cidx.toml from detection results.

func UpdateTOML added in v1.7.0

func UpdateTOML(raw string, diff *DiffResult) string

UpdateTOML applies additive changes from a DiffResult to raw TOML content. It preserves all existing content, comments, and formatting. Only containers arrays in matching phases are extended, and new phases are appended.

Types

type Detection

type Detection struct {
	Languages []Language
	HasGit    bool
	Remote    string // "github" or "gitlab" or ""
}

Detection holds the results of project analysis.

func Detect

func Detect(dir string) *Detection

Detect analyzes the current directory to determine project type.

type DiffResult added in v1.7.0

type DiffResult struct {
	Changes   []PhaseChange
	NewPhases []PhaseChange // entirely new phases (not in existing config)
}

DiffResult holds the comparison between fresh detection and existing config.

func Compare added in v1.7.0

func Compare(detection *Detection, existingPhases map[string][]string) *DiffResult

Compare computes the additive diff between a fresh detection and existing config phases. existingPhases maps phase name to its current container list.

func (*DiffResult) HasChanges added in v1.7.0

func (d *DiffResult) HasChanges() bool

HasChanges returns true if the diff contains any additions.

func (*DiffResult) TotalAdded added in v1.7.0

func (d *DiffResult) TotalAdded() int

TotalAdded returns the total number of new containers across all phases.

type Language

type Language struct {
	Name     string
	Marker   string // file that triggered detection
	Security []string
	Code     []string
	Test     []string
	Build    []string
}

Language represents a detected project language/ecosystem.

type PhaseChange added in v1.7.0

type PhaseChange struct {
	Phase    string
	Added    []string // containers found by detection but missing from config
	Existing []string // containers already in config for this phase
}

PhaseChange describes additions to a single phase.

Jump to

Keyboard shortcuts

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