report

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModifiedFile

type ModifiedFile struct {
	// contains filtered or unexported fields
}

ModifiedFile represents a file that has been modified by Orchestrion.

func NewModifiedFile

func NewModifiedFile(fsys fs.FS, modifiedPath string) (ModifiedFile, error)

NewModifiedFile creates a new ModifiedFile from the given file system and modified path. If the modified file contains a line directive, it will parse it to find the original path.

func (ModifiedFile) ImportPath

func (m ModifiedFile) ImportPath() string

ImportPath converts the modified file path to an import path.

func (ModifiedFile) String

func (m ModifiedFile) String() string

type Report

type Report struct {
	// contains filtered or unexported fields
}

Report represents a collection of modified files that were generated by Orchestrion. It implements the fs.FS interface, allowing it to be used as a file system rooted in "/". This will open every file normally expect for files that have been modified by Orchestrion, in which case it will open the modified file instead of the original file.

func FromWorkDir

func FromWorkDir(ctx context.Context, dir string) (Report, error)

FromWorkDir reads the orchestrion files from a `go build -work` directory and creates a Report out of it.

func (Report) Diff

func (r Report) Diff(writer io.Writer) error

Diff generates a diff between the original and modified files and writes it to the writer.

func (Report) Files

func (r Report) Files() []ModifiedFile

Files returns an iterator over the modified files in the report.

func (Report) IsEmpty

func (r Report) IsEmpty() bool

IsEmpty checks if the report contains no modified files.

func (Report) Open

func (r Report) Open(name string) (fs.File, error)

func (Report) Packages

func (r Report) Packages() []string

Packages returns an iterator over the unique package names found in the report. It extracts the package names from the file paths, assuming they follow the convention of being constructed as "<work-dir>/orchestrion/src/<github.com/my/repo>/<file.go>".

func (Report) WithRegexFilter

func (r Report) WithRegexFilter(regex string) (Report, error)

WithRegexFilter filters the files in the report based on a regex pattern.

func (Report) WithSpecialCasesFilter

func (r Report) WithSpecialCasesFilter() Report

WithSpecialCasesFilter filters the files in the report to include only those that are not weaver special cases

Jump to

Keyboard shortcuts

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