sane

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REPOSITORY_PATH_PLACEHOLDER  = "$REPOSITORY"
	REPOSITORY_SANE_DEFAULT_FILE = ".sane"
)
View Source
const (
	MaxRules = 1000
)
View Source
const (
	RULES_FORMAT_GITIGNORE = "gitignore"
)

Variables

This section is empty.

Functions

func Debugf

func Debugf(msg string, args ...any)

func Errorf

func Errorf(msg string, args ...any)

func Execute

func Execute(config Config) error

Primary entrypoint for validator

func Infof

func Infof(msg string, args ...any)

func LoggerWith

func LoggerWith(key string, value any) *logrus.Entry

func LoggerWithError

func LoggerWithError(err error) *logrus.Entry

func SetLogLevel

func SetLogLevel(verbose, debug bool)

func Warnf

func Warnf(msg string, args ...any)

Types

type Config

type Config struct {
	RepositoryPath string
	RulesPath      string
	RulesType      RuleFormat
	FailFast       bool
	Strict         bool
}

type RepositoryNode

type RepositoryNode struct {
	FullPath string
}

type RepositoryNodeHandler

type RepositoryNodeHandler func(RepositoryNode) error

type RepositoryWalker

type RepositoryWalker interface {
	Walk(RepositoryNodeHandler) error
}

type RuleEngine

type RuleEngine interface {
	// Validate a single repository node with the loaded rules
	// This validation should be performed in a stateless manner
	Validate(RepositoryNode) (bool, error)

	// Finalize the validation state (if any) and return error (if any)
	Finalize() error

	// Reset validatin state
	Reset()
}

type RuleFormat

type RuleFormat string

Jump to

Keyboard shortcuts

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