Configuration

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// The path to the sources to analyze
	SourcesToAnalyzePath []string `yaml:"sources"`

	// Exclude patterns (list of regular expressions. When a file matches one of these patterns, it is not analyzed)
	ExcludePatterns []string `yaml:"exclude"`

	// Reports
	Reports ConfigurationReport `yaml:"reports"`

	// Requirements
	Requirements *ConfigurationRequirements `yaml:"requirements"`

	Watching bool

	// if not empty, compare the current analysis with the one in this branch / commit
	CompareWith string

	// Location of cache files
	Storage *Storage.Workdir
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) SetExcludePatterns

func (c *Configuration) SetExcludePatterns(patterns []string)

func (*Configuration) SetSourcesToAnalyzePath

func (c *Configuration) SetSourcesToAnalyzePath(paths []string) error

type ConfigurationDefaultRule added in v0.15.0

type ConfigurationDefaultRule struct {
	Max             int      `yaml:"max"`
	Min             int      `yaml:"min"`
	ExcludePatterns []string `yaml:"exclude"`
}

type ConfigurationLoader added in v0.15.0

type ConfigurationLoader struct {
	FilenameToChecks []string
}

func NewConfigurationLoader added in v0.15.0

func NewConfigurationLoader() *ConfigurationLoader

func (*ConfigurationLoader) CreateDefaultFile added in v0.15.0

func (c *ConfigurationLoader) CreateDefaultFile() error

func (*ConfigurationLoader) Import added in v0.16.0

func (c *ConfigurationLoader) Import(yamlString string) (*Configuration, error)

func (*ConfigurationLoader) Loads added in v0.15.0

type ConfigurationReport added in v0.15.0

type ConfigurationReport struct {
	Html     string `yaml:"html"`
	Markdown string `yaml:"markdown"`
}

type ConfigurationRequirements added in v0.15.0

type ConfigurationRequirements struct {
	Rules *struct {
		CyclomaticComplexity *ConfigurationDefaultRule `yaml:"cyclomatic_complexity"`
		Loc                  *ConfigurationDefaultRule `yaml:"loc"`
		Maintainability      *ConfigurationDefaultRule `yaml:"maintainability"`
		Coupling             *struct {
			Forbidden []struct {
				From string `yaml:"from"`
				To   string `yaml:"to"`
			} `yaml:"forbidden"`
		} `yaml:"coupling"`
	} `yaml:"rules"`

	FailOnError bool `yaml:"fail_on_error"`
}

Jump to

Keyboard shortcuts

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