Documentation
¶
Index ¶
- Constants
- Variables
- func LabelRanges(path string) (map[string]core.LineRange, error)
- func ParseChangedLines(diffText string) (map[string]*core.FileChanges, error)
- func ParseChangedLinesReader(r io.Reader) (map[string]*core.FileChanges, error)
- func ResolveTarget(src, raw string) core.TargetRef
- func ValidateFixPath(root, target string) error
- type FileProvider
- type FileProviderFactory
- type FileStat
- type GitHubFactory
- type GitHubRemote
- type Options
- type Result
Constants ¶
const ( CombinedDiffStrict = "strict" CombinedDiffWarn = "warn" CombinedDiffIgnore = "ignore" CombinedDiffParent = "parent" )
Variables ¶
var ErrStatUnsupported = errors.New("file provider stat unsupported")
Functions ¶
func LabelRanges ¶
LabelRanges returns the label line ranges for the given file by parsing directives.
func ParseChangedLines ¶
func ParseChangedLines(diffText string) (map[string]*core.FileChanges, error)
Build changes map from a unified diff string using diff.Parser.
func ParseChangedLinesReader ¶
func ResolveTarget ¶
ResolveTarget resolves a selector using the configured directive grammar. Local target paths use forward slashes on every host. Workspace-root targets remain relative so callers can apply their own root.
func ValidateFixPath ¶
ValidateFixPath rejects directive-driven writes outside root or through symlinks.
Types ¶
type FileProvider ¶
type FileProvider interface {
ReadFile(path string) ([]byte, error)
Stat(path string) (FileStat, error)
}
FileProvider abstracts file access so alternative backends (e.g., remote blobs) can supply source/target contents without touching the local filesystem.
type FileProviderFactory ¶
type GitHubFactory ¶
type GitHubFactory struct {
// contains filtered or unexported fields
}
GitHubFactory registers GitHub providers for multiple repositories.
func NewGitHubFactory ¶
func NewGitHubFactory(remotes []GitHubRemote) (*GitHubFactory, error)
NewGitHubFactory constructs a provider factory for the supplied remotes.
func (*GitHubFactory) Match ¶
func (f *GitHubFactory) Match(target string) bool
func (*GitHubFactory) Provider ¶
func (f *GitHubFactory) Provider(target string) (FileProvider, string, error)
type GitHubRemote ¶
GitHubRemote describes configuration for a GitHub repository integration.
type Options ¶
type Options struct {
Syntax *core.DirectiveSyntax
// ConfigOverrides records explicit CLI policies for snapshot configuration.
ConfigOverrides map[string]bool
// RevisionChanges and ReverseCandidates describe an immutable source snapshot.
// RevisionChanges keys and FileChanges paths use repository forward slashes.
RevisionChanges map[string]*core.FileChanges
ReverseCandidates []string
MatchCandidates []string
// DependencyChanges supplies foreign changed-line evidence without adding sources.
DependencyChanges func(string) (*core.FileChanges, error)
// DependencyConfigChanged requests structural revalidation, not co-change evidence.
DependencyConfigChanged func(string) bool
Repository *vcs.Backend
StrictPaths bool
Parallelism int
Verbose bool
Ignores []string // file or file#label
IgnoreBaseDir string // optional configuration coordinate root
CodeOnly bool
UnknownPolicy string // error|warn|ignore
SkipDirs []string
Fix bool
Files FileProvider
Factories []FileProviderFactory
CombinedDiffPolicy string
SuppressCoChanges bool
SourceFiles []string
StructuralFiles []string
}