config

package
v0.0.0-...-a10075e Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal(data []byte, config *Config) error

Unmarshal parse the YAML-encoded configuration file from data and stores the result in the value pointed by config. If

Types

type Config

type Config struct {
	Linters         Linters
	LintersSettings LintersSettings `mapstructure:"linters-settings"`
}

Config is the root of a configuration.

func (Config) EnabledLinters

func (c Config) EnabledLinters() map[string]LinterSettings

EnabledLinters return the list of effectively enabled linters.

type Filters

type Filters struct {
	GitPattern  []string `mapstructure:"git-pattern"`
	FindPattern []string `mapstructure:"find-pattern"`
	Files       []string
	Folders     []string
}

Filters limit the linted files with various filtering patterns. Some linter may not use all patterns.

type InvalidStructureError

type InvalidStructureError struct {
	Err error
}

An InvalidStructureError describes a not well structured config file passed to Unmarshal.

func (*InvalidStructureError) Error

func (e *InvalidStructureError) Error() string

type InvalidYamlError

type InvalidYamlError struct {
	Err error
}

An InvalidYamlError describes a not well YAML formated invalid input passed to Unmarshal.

func (*InvalidYamlError) Error

func (e *InvalidYamlError) Error() string

type LinterSettings

type LinterSettings struct {
	Version []string
	Command []string
	Args    []string
	Workdir string
	Filters Filters
}

LinterSettings hold one linter configuration.

type Linters

type Linters struct {
	Enable  []string
	Disable []string
}

Linters say which linter is enabled or disabled.

type LintersSettings

type LintersSettings struct {
	Settings map[string]LinterSettings `mapstructure:",remain"`
}

LintersSettings is just a wrapper for all the linters settings.

Jump to

Keyboard shortcuts

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