scan

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duplicate

type Duplicate struct {
	RemoteKey       string   `json:"remote_key"`
	Paths           []string `json:"paths"`
	RecommendedPath string   `json:"recommended_path"`
}

type Finding

type Finding struct {
	Path          string   `json:"path"`
	Type          Type     `json:"type"`
	RemoteURL     string   `json:"remote_url,omitempty"`
	RemoteKey     string   `json:"remote_key,omitempty"`
	DefaultBranch string   `json:"default_branch,omitempty"`
	Warnings      []string `json:"warnings,omitempty"`
}

type Options

type Options struct {
	IncludePlainFolders bool
	Git                 dsgit.Runner
	// Ignore overrides the compiled ignore policy used to prune directories.
	// When nil, Walk compiles the root's .devstrapignore itself (falling back
	// to defaults with a warning on a compile error). Tests inject a Matcher
	// here to avoid touching the real filesystem's .devstrapignore.
	Ignore *ignore.Matcher
}

type Result

type Result struct {
	Root       string      `json:"root"`
	Findings   []Finding   `json:"findings"`
	Warnings   []string    `json:"warnings,omitempty"`
	Duplicates []Duplicate `json:"duplicates,omitempty"`
	// Secrets lists secret-looking files (relative slash paths) discovered
	// during the walk so callers can quarantine or ignore them.
	Secrets []string `json:"secrets,omitempty"`
	// PrunedDirs counts directories skipped by the ignore rules (defaults +
	// root .devstrapignore). Informational: the CLI surfaces it as progress
	// output, not a warning, so run-loop ticks stay quiet about routine prunes.
	PrunedDirs int
}

func Walk

func Walk(ctx context.Context, root string, opts Options) (Result, error)

type Type

type Type string
const (
	TypeGitRepo     Type = "git_repo"
	TypeLocalGit    Type = "local_git" // NOVCS-01: git repo with no usable remote; never synced as clonable.
	TypeDraftFolder Type = "draft_project"
	TypePlainFolder Type = "plain_folder"
)

Jump to

Keyboard shortcuts

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