configvalidator

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_ALLOWED_VERSION = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	Name                string      `mapstructure:"name,omitempty" json:"name,omitempty"`
	RuntimeVersion      string      `mapstructure:"runtime_version,omitempty" json:"runtime_version,omitempty"`
	Enabled             bool        `mapstructure:"enabled,omitempty" json:"enabled"`
	DependencyFilePaths []string    `mapstructure:"dependency_file_paths,omitempty" json:"dependency_file_paths,omitempty"`
	Meta                interface{} `mapstructure:"meta,omitempty" json:"meta,omitempty"`
	Thresholds          interface{} `mapstructure:"thresholds,omitempty" json:"thresholds,omitempty"`
}

DSConfig is the struct for .deepsource.toml file

type ConfigValidator

type ConfigValidator struct {
	Config DSConfig
	Result Result
}

Struct to store the meta (Config) and output (Result) of config validation

func (*ConfigValidator) ValidateConfig

func (c *ConfigValidator) ValidateConfig(inputConfig []byte) Result

Entrypoint to the package `configvalidator` Accepts DeepSource config as a parameter and validates it

type DSConfig

type DSConfig struct {
	Version         int           `mapstructure:"version,omitempty" json:"version"`
	ExcludePatterns []string      `mapstructure:"exclude_patterns,omitempty" json:"exclude_patterns,omitempty"`
	TestPatterns    []string      `mapstructure:"test_patterns,omitempty" json:"test_patterns,omitempty"`
	Analyzers       []Analyzer    `mapstructure:"analyzers,omitempty" json:"analyzers,omitempty"`
	Transformers    []Transformer `mapstructure:"transformers,omitempty" json:"transformers,omitempty"`
}

type Result

type Result struct {
	Valid           bool
	Errors          []string
	ConfigReadError bool
}

type Transformer

type Transformer struct {
	Name    string `mapstructure:"name,omitempty" json:"name,omitempty"`
	Enabled bool   `mapstructure:"enabled,omitempty" json:"enabled,omitempty"`
}

Jump to

Keyboard shortcuts

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