repoconfig

package
v0.9.0-legacy Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRelativePathFromGitRoot

func GetRelativePathFromGitRoot(gitRoot, dirPath string) (string, error)

GetRelativePathFromGitRoot returns the relative path of a directory within the git root directory. For example, if git root is "/aa/bb/cc/" and the directory is "/aa/bb/cc/dd/ee", it will return "dd/ee".

Types

type Config

type Config struct {
	SmartTests []string `yaml:"smart_tests"`
}

Config represents the .signadot/config.yaml file contents

func LoadConfig

func LoadConfig(repo *GitRepo) (*Config, error)

LoadConfig reads the .signadot/config.yaml file from the git repository root

type GitRepo

type GitRepo struct {
	Path      string
	Repo      string
	Branch    string
	CommitSHA string
}

func FindGitRepo

func FindGitRepo(startPath string) (*GitRepo, error)

type LabelsCache

type LabelsCache interface {
	ForFile(p string) (map[string]string, error)
}

func NewLabelsCache

func NewLabelsCache(rootPath string) (LabelsCache, error)

type TestFile

type TestFile struct {
	Name   string            // Test name
	Path   string            // Full path relative to base directory
	Reader io.Reader         // if Path is empty, may be a Reader
	Labels map[string]string // Labels from all parent directories
}

TestFile represents a test file found in the tests directory

type TestFinder

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

func NewTestFinder

func NewTestFinder(inputPath string) (*TestFinder, error)

func (*TestFinder) FindTestFiles

func (tf *TestFinder) FindTestFiles() ([]TestFile, error)

FindTestFiles finds all test files in the tests directories

func (*TestFinder) GetGitRepo

func (tf *TestFinder) GetGitRepo() *GitRepo

Jump to

Keyboard shortcuts

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