checker

package
v0.0.0-...-88ab25c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRepoFinderFactoryForUPM

func NewRepoFinderFactoryForUPM(rootDirAbs typedpath.RawPath, opts *Options) repofinder.RepoFinder

func NewRepoFinderForUnityProj

func NewRepoFinderForUnityProj(rootDirAbs typedpath.RawPath, opts *Options, foundPackages []*unity.FoundPackage) repofinder.RepoFinder

Types

type CheckResult

type CheckResult struct {
	MissingMeta  []typedpath.SlashPath
	DanglingMeta []typedpath.SlashPath
}

func NewCheckResult

func NewCheckResult(missingMeta []typedpath.SlashPath, danglingMeta []typedpath.SlashPath) *CheckResult

func (CheckResult) Empty

func (c CheckResult) Empty() bool

func (CheckResult) Len

func (c CheckResult) Len() int

type Checker

type Checker func(rootDirAbs typedpath.RawPath, opts *Options) (*CheckResult, error)

func NewChecker

func NewChecker(selectStrategy StrategySelector, logger logging.Logger) Checker

func StubChecker

func StubChecker(result *CheckResult, err error) Checker

type CheckingWorker

type CheckingWorker func(rootDirAbs typedpath.RawPath, ignoreCase bool, reader <-chan filecollector.Entry) (*CheckResult, error)

func NewCheckingWorker

func NewCheckingWorker(requiresMeta unity.MetaNecessity, logger logging.Logger) CheckingWorker

type Options

type Options struct {
	IgnoreCase                bool
	IgnoreSubmodulesAndNested bool
	TargetType                TargetType
}

Options for Checker. NOTE: We should keep this options simple because the newWorker logic is already complicated.

Implement on ResultFilter if you want to filter the CheckResult.

type Strategy

type Strategy struct {
	CollectFiles filecollector.FileAggregator
	RequiresMeta unity.MetaNecessity
}

type StrategySelector

type StrategySelector func(rootDirAbs typedpath.RawPath, opts *Options) (Strategy, error)

func NewStrategySelector

func NewStrategySelector(findPackages unity.FindPackages, lsFiles git.LsFiles, logger logging.Logger) StrategySelector

NewStrategySelector returns a checker strategy for either Unity projects or UPM packages.

type TargetType

type TargetType string
const (
	// TargetTypeIsUnityProjectRootDirectory means the target root directory point to a root directory of the Unity project.
	TargetTypeIsUnityProjectRootDirectory TargetType = "TargetTypeIsUnityProjectRootDirectory"

	// TargetTypeIsUnityProjectSubDirectory means the target root directory point to a sub directory that need meta files of the Unity project.
	// NOTE: this including UPM packages (because Packages/com.example.foo/ is a sub directory that need meta files of Unity projects).
	TargetTypeIsUnityProjectSubDirectory TargetType = "TargetTypeIsUnityProjectSubDirectory"
)

Jump to

Keyboard shortcuts

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