Documentation
¶
Overview ¶
Package layout audits and safely cleans local clone placement under a projects root. Canonical clones live at {root}/{owner}/{repository}.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanFailed ¶
func CleanFailed(report CleanReport) bool
CleanFailed reports whether clean had errors or leftover skips that need attention when apply was requested. Dry-run never fails solely for planned removals.
Types ¶
type CleanAction ¶
type CleanAction struct {
Path string `json:"path" yaml:"path"`
OriginSlug string `json:"origin_slug,omitempty" yaml:"origin_slug,omitempty"`
Status string `json:"status" yaml:"status"` // removed, planned, skipped, error
Reason string `json:"reason" yaml:"reason"`
}
CleanAction is one planned or applied cleanup.
type CleanOptions ¶
CleanOptions controls safe removal of top-level clones.
type CleanReport ¶
type CleanReport struct {
SchemaVersion int `json:"schema_version" yaml:"schema_version"`
ProjectsRoot string `json:"projects_root" yaml:"projects_root"`
DryRun bool `json:"dry_run" yaml:"dry_run"`
Actions []CleanAction `json:"actions" yaml:"actions"`
}
CleanReport summarizes a clean run.
func Clean ¶
func Clean(ctx context.Context, projectsRoot string, options CleanOptions) (CleanReport, error)
Clean removes safe top-level clones. Without Apply it only plans.
func (CleanReport) Markdown ¶
func (report CleanReport) Markdown() string
Markdown renders a clean plan/result.
type Finding ¶
type Finding struct {
Path string `json:"path" yaml:"path"`
Kind Kind `json:"kind" yaml:"kind"`
PathSlug string `json:"path_slug,omitempty" yaml:"path_slug,omitempty"`
OriginSlug string `json:"origin_slug,omitempty" yaml:"origin_slug,omitempty"`
ExpectedPath string `json:"expected_path,omitempty" yaml:"expected_path,omitempty"`
CanonicalExists bool `json:"canonical_exists,omitempty" yaml:"canonical_exists,omitempty"`
Reason string `json:"reason" yaml:"reason"`
}
Finding is one inspected checkout relative to the projects root.
type Report ¶
type Report struct {
SchemaVersion int `json:"schema_version" yaml:"schema_version"`
ProjectsRoot string `json:"projects_root" yaml:"projects_root"`
ObservedAt time.Time `json:"observed_at" yaml:"observed_at"`
Summary Summary `json:"summary" yaml:"summary"`
Findings []Finding `json:"findings" yaml:"findings"`
}
Report is the deterministic layout audit index.
type Summary ¶
type Summary struct {
Inspected int `json:"inspected" yaml:"inspected"`
OK int `json:"ok" yaml:"ok"`
TopLevel int `json:"top_level" yaml:"top_level"`
Misowned int `json:"misowned" yaml:"misowned"`
NoOrigin int `json:"no_origin" yaml:"no_origin"`
Unreadable int `json:"unreadable" yaml:"unreadable"`
}
Summary counts findings by kind.