configvalidator

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: BSD-2-Clause Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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