Documentation
¶
Overview ¶
Package linter provides revision of templates. Linter configuration is in default/style.yaml.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckStyle ¶
CheckStyle gets linter configuration and run checking.
Types ¶
type AllowedLists ¶
AllowedLists describes which types of lists are correct.
type Check ¶
type Check struct {
Required bool `yaml:"required"`
Value interface{} `yaml:"value"`
}
Check stores information about if something is required or not and value e.g indent.
type GlobalLinterConfiguration ¶
type GlobalLinterConfiguration struct {
LineLength Check `yaml:"lineLength"`
Indent Check `yaml:"indent"`
RequiredFields RequiredFields `yaml:"requiredFields"`
NamingConventions NamingConventions `yaml:"namingConventions"`
BlankLinesAllowed bool `yaml:"blankLinesAllowed"`
}
GlobalLinterConfiguration describes global configuration. It's used in LinterConfiguration as one of type of Linter.
type JsonLinterConfiguration ¶
type JsonLinterConfiguration struct {
Spaces SpacesConfiguration `yaml:"spaces"`
}
JsonLinterConfiguration describes where should be spaces.
type LinterConfiguration ¶
type LinterConfiguration struct {
Yaml YamlLinterConfiguration `yaml:"yaml"`
Json JsonLinterConfiguration `yaml:"json"`
Global GlobalLinterConfiguration `yaml:"global"`
}
LinterConfiguration contains configuration for two types - Yaml and JSON, and global.
func GetLinterConfiguration ¶
func GetLinterConfiguration(ctx *context.Context) (err error, lintConf LinterConfiguration)
GetLinterConfiguration gets configuration from file.
func (LinterConfiguration) CheckLogicalName ¶
func (this LinterConfiguration) CheckLogicalName(name string) bool
CheckLogicalName checks name. It use NamingConventions.
type NamingConventions ¶
type NamingConventions struct {
LogicalNames string `yaml:"logicalNames"`
}
NamingConventions describes how should looks names.
type Parameter ¶
type Parameter struct {
Type string `json:"Type"`
Default string `json:"Default"`
AllowedValues []string `json:"AllowedValues"`
Description string `json:"Description"`
}
Parameter describes all element which parameter in template should have.
type Quotes ¶
type Quotes struct {
Single bool `yaml:"single"`
Double bool `yaml:"double"`
Noquotes bool `yaml:"noquotes"`
}
Quotes describes types of quotes.
type RequiredFields ¶
type RequiredFields struct {
TemplateDescription bool `yaml:"templateDescription"`
ParametersDescription bool `yaml:"parametersDescription"`
}
RequiredFields says which elements in template are required.
type SpacesConfiguration ¶
SpacesConfiguration stores information about spaces before and after something.
type YamlLinterConfiguration ¶
type YamlLinterConfiguration struct {
AllowedQuotes Quotes `yaml:"allowedQuotes"`
AllowedLists AllowedLists `yaml:"allowedLists"`
ContinuationIndent Check `yaml:"continuationIndent"`
}
YamlLinterConfiguration describes configuration for Yaml - what type of quotes, lists and indent is used.