config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindToFlags

func BindToFlags(cfg *Config, fs *flag.FlagSet)

BindToFlags binds Config fields to according flags.

Types

type BoolCompareConfig added in v1.2.0

type BoolCompareConfig struct {
	IgnoreCustomTypes bool
}

BoolCompareConfig implements configuration of checkers.BoolCompare.

type Config

type Config struct {
	EnableAll        bool
	DisabledCheckers KnownCheckersValue
	DisableAll       bool
	EnabledCheckers  KnownCheckersValue

	BoolCompare          BoolCompareConfig
	ExpectedActual       ExpectedActualConfig
	RequireError         RequireErrorConfig
	SuiteExtraAssertCall SuiteExtraAssertCallConfig
}

Config implements testifylint configuration.

func NewDefault

func NewDefault() Config

NewDefault builds default testifylint config.

func (Config) Validate added in v1.0.0

func (cfg Config) Validate() error

type EnumValue

type EnumValue[EnumT comparable] struct {
	// contains filtered or unexported fields
}

EnumValue is a special type for support of flag.FlagSet over user-defined constants.

func NewEnumValue

func NewEnumValue[EnumT comparable](mapping map[string]EnumT, dst *EnumT) *EnumValue[EnumT]

NewEnumValue takes the "enum-value-name to enum-value" mapping and a destination for the value passed through the CLI. Returns an EnumValue instance suitable for flag.FlagSet.Var.

func (*EnumValue[EnumT]) Set

func (e *EnumValue[EnumT]) Set(s string) error

func (EnumValue[EnumT]) String

func (e EnumValue[EnumT]) String() string

type ExpectedActualConfig

type ExpectedActualConfig struct {
	ExpVarPattern RegexpValue
}

ExpectedActualConfig implements configuration of checkers.ExpectedActual.

type KnownCheckersValue

type KnownCheckersValue []string

KnownCheckersValue implements comma separated list of testify checkers.

func (KnownCheckersValue) Contains added in v1.0.0

func (kcv KnownCheckersValue) Contains(v string) bool

func (*KnownCheckersValue) Set

func (kcv *KnownCheckersValue) Set(v string) error

func (KnownCheckersValue) String

func (kcv KnownCheckersValue) String() string

type RegexpValue

type RegexpValue struct {
	*regexp.Regexp
}

RegexpValue is a special wrapper for support of flag.FlagSet over regexp.Regexp. Original regexp is available through RegexpValue.Regexp.

func (*RegexpValue) Set

func (rv *RegexpValue) Set(v string) error

func (RegexpValue) String

func (rv RegexpValue) String() string

type RequireErrorConfig added in v1.0.0

type RequireErrorConfig struct {
	FnPattern RegexpValue
}

RequireErrorConfig implements configuration of checkers.RequireError.

type SuiteExtraAssertCallConfig

type SuiteExtraAssertCallConfig struct {
	Mode checkers.SuiteExtraAssertCallMode
}

SuiteExtraAssertCallConfig implements configuration of checkers.SuiteExtraAssertCall.

Jump to

Keyboard shortcuts

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