configvalidator

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: BSD-2-Clause Imports: 7 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" 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 AnalyzersData

type AnalyzersData struct {
	AnalyzerNames      []string
	AnalyzerShortcodes []string
	AnalyzerMap        map[string]string
	AnalyzesMeta       []string
}

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, analyzersData AnalyzersData, transformersData TransformersData) Result

Entrypoint to the package `configvalidator` Accepts a string of deepsource config and validates it

type DSConfig

type DSConfig struct {
	Version         int           `mapstructure:"version" json:"version"`
	ExcludePatterns []string      `mapstructure:"exclude_patterns" 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" json:"name"`
	Enabled bool   `mapstructure:"enabled" json:"enabled"`
}

type TransformersData

type TransformersData struct {
	TransformerNames      []string
	TransformerShortcodes []string
	TransformerMap        map[string]string
}

Jump to

Keyboard shortcuts

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