config

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version           int                 `yaml:"version,omitempty"`
	Threshold         *Threshold          `yaml:"threshold,omitempty"`
	DependenciesRules []*DependenciesRule `yaml:"dependenciesRules,omitempty"`
	ContentRules      []*ContentsRule     `yaml:"contentsRules,omitempty"`
	CyclesRules       []*CyclesRule       `yaml:"cyclesRules,omitempty"`
	FunctionsRules    []*FunctionsRule    `yaml:"functionsRules,omitempty"`
	NamingRules       []*NamingRule       `yaml:"namingRules,omitempty"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

type ContentsRule

type ContentsRule struct {
	Package                     string `yaml:"package,omitempty"`
	ShouldOnlyContainInterfaces bool   `yaml:"shouldOnlyContainInterfaces,omitempty"`
	ShouldOnlyContainStructs    bool   `yaml:"shouldOnlyContainStructs,omitempty"`
	ShouldOnlyContainFunctions  bool   `yaml:"shouldOnlyContainFunctions,omitempty"`
	ShouldOnlyContainMethods    bool   `yaml:"shouldOnlyContainMethods,omitempty"`
	ShouldNotContainInterfaces  bool   `yaml:"shouldNotContainInterfaces,omitempty"`
	ShouldNotContainStructs     bool   `yaml:"shouldNotContainStructs,omitempty"`
	ShouldNotContainFunctions   bool   `yaml:"shouldNotContainFunctions,omitempty"`
	ShouldNotContainMethods     bool   `yaml:"shouldNotContainMethods,omitempty"`
}

type CyclesRule

type CyclesRule struct {
	Package                string `yaml:"package,omitempty"`
	ShouldNotContainCycles bool   `yaml:"shouldNotContainCycles,omitempty"`
}

type Dependencies added in v1.0.0

type Dependencies struct {
	Internal []string `yaml:"internal,omitempty"`
	External []string `yaml:"external,omitempty"`
	Standard []string `yaml:"standard,omitempty"`
}

type DependenciesRule

type DependenciesRule struct {
	Package             string        `yaml:"package,omitempty"`
	ShouldOnlyDependsOn *Dependencies `yaml:"shouldOnlyDependsOn,omitempty"`
	ShouldNotDependsOn  *Dependencies `yaml:"shouldNotDependsOn,omitempty"`
}

type DeprecatedConfig added in v1.0.0

type DeprecatedConfig struct {
	DependenciesRules []*DeprecatedDependenciesRule `yaml:"dependenciesRules,omitempty"`
	ContentRules      []*ContentsRule               `yaml:"contentsRules,omitempty"`
	CyclesRules       []*CyclesRule                 `yaml:"cyclesRules,omitempty"`
	FunctionsRules    []*FunctionsRule              `yaml:"functionsRules,omitempty"`
	NamingRules       []*NamingRule                 `yaml:"namingRules,omitempty"`
}

func LoadDeprecatedConfig added in v1.0.0

func LoadDeprecatedConfig(configPath string) (*DeprecatedConfig, error)

type DeprecatedDependenciesRule added in v1.0.0

type DeprecatedDependenciesRule struct {
	Package                     string   `yaml:"package,omitempty"`
	ShouldOnlyDependsOn         []string `yaml:"shouldOnlyDependsOn,omitempty"`
	ShouldNotDependsOn          []string `yaml:"shouldNotDependsOn,omitempty"`
	ShouldOnlyDependsOnExternal []string `yaml:"shouldOnlyDependsOnExternal,omitempty"`
	ShouldNotDependsOnExternal  []string `yaml:"shouldNotDependsOnExternal,omitempty"`
}

type FunctionsRule

type FunctionsRule struct {
	Package                  string `yaml:"package,omitempty"`
	MaxParameters            int    `yaml:"maxParameters,omitempty"`
	MaxReturnValues          int    `yaml:"maxReturnValues,omitempty"`
	MaxLines                 int    `yaml:"maxLines,omitempty"`
	MaxPublicFunctionPerFile int    `yaml:"maxPublicFunctionPerFile,omitempty"`
}

type InterfaceImplementationRule added in v0.4.0

type InterfaceImplementationRule struct {
	StructsThatImplement             string `yaml:"structsThatImplement"`
	ShouldHaveSimpleNameStartingWith string `yaml:"shouldHaveSimpleNameStartingWith"`
	ShouldHaveSimpleNameEndingWith   string `yaml:"shouldHaveSimpleNameEndingWith"`
}

type NamingRule added in v0.4.0

type NamingRule struct {
	Package                           string                       `yaml:"package"`
	InterfaceImplementationNamingRule *InterfaceImplementationRule `yaml:"interfaceImplementationNamingRule"`
}

type Threshold added in v1.1.0

type Threshold struct {
	Compliance *int `yaml:"compliance,omitempty"`
	Coverage   *int `yaml:"coverage,omitempty"`
}

Jump to

Keyboard shortcuts

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