config

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directories

type Directories struct {
	Exclude []string `yaml:"exclude"`
}

Directories represents the target directories.

type EnumFieldNamesZeroValueEndWithOption added in v0.10.0

type EnumFieldNamesZeroValueEndWithOption struct {
	Suffix string `yaml:"suffix"`
}

EnumFieldNamesZeroValueEndWithOption represents the option for the ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH rule.

type EnumFieldsHaveCommentOption added in v0.13.0

type EnumFieldsHaveCommentOption struct {
	ShouldFollowGolangStyle bool `yaml:"should_follow_golang_style"`
}

EnumFieldsHaveCommentOption represents the option for the ENUM_FIELDS_HAVE_COMMENT rule.

type EnumsHaveCommentOption added in v0.13.0

type EnumsHaveCommentOption struct {
	ShouldFollowGolangStyle bool `yaml:"should_follow_golang_style"`
}

EnumsHaveCommentOption represents the option for the ENUMS_HAVE_COMMENT rule.

type ExternalConfig

type ExternalConfig struct {
	Lint Lint
}

ExternalConfig represents the external configuration.

func GetExternalConfig

func GetExternalConfig(
	filePath string,
	dirPath string,
) (ExternalConfig, error)

GetExternalConfig provides the externalConfig.

func (ExternalConfig) ShouldSkipRule

func (c ExternalConfig) ShouldSkipRule(
	ruleID string,
	displayPath string,
	defaultRuleIDs []string,
) bool

ShouldSkipRule checks whether to skip applying the rule to the file.

type FieldNamesExcludePrepositionsOption added in v0.10.0

type FieldNamesExcludePrepositionsOption struct {
	Prepositions []string `yaml:"prepositions"`
	Excludes     []string `yaml:"excludes"`
}

FieldNamesExcludePrepositionsOption represents the option for the FIELD_NAMES_EXCLUDE_PREPOSITIONS rule.

type FieldsHaveCommentOption added in v0.13.0

type FieldsHaveCommentOption struct {
	ShouldFollowGolangStyle bool `yaml:"should_follow_golang_style"`
}

FieldsHaveCommentOption represents the option for the FIELDS_HAVE_COMMENT rule.

type FileNamesLowerSnakeCaseOption added in v0.10.0

type FileNamesLowerSnakeCaseOption struct {
	Excludes []string `yaml:"excludes"`
}

FileNamesLowerSnakeCaseOption represents the option for the FILE_NAMES_LOWER_SNAKE_CASE rule.

type Files added in v0.12.0

type Files struct {
	Exclude []string `yaml:"exclude"`
}

Files represents the target files.

type Ignore

type Ignore struct {
	ID    string   `yaml:"id"`
	Files []string `yaml:"files"`
}

Ignore represents files ignoring the specific rule.

type Ignores

type Ignores []Ignore

Ignores represents list about files ignoring the specific rule.

type ImportsSortedOption added in v0.11.0

type ImportsSortedOption struct {
	Newline string
}

ImportsSortedOption represents the option for the IMPORTS_SORTED rule.

func (*ImportsSortedOption) UnmarshalYAML added in v0.11.0

func (i *ImportsSortedOption) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.v2 Unmarshaler interface.

type IndentOption

type IndentOption struct {
	Style   string
	Newline string
}

IndentOption represents the option for the INDENT rule.

func (*IndentOption) UnmarshalYAML

func (i *IndentOption) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.v2 Unmarshaler interface.

type Lint

type Lint struct {
	Ignores     Ignores
	Files       Files
	Directories Directories
	Rules       Rules
	RulesOption RulesOption `yaml:"rules_option"`
}

Lint represents the lint configuration.

type MaxLineLengthOption

type MaxLineLengthOption struct {
	MaxChars int `yaml:"max_chars"`
	TabChars int `yaml:"tab_chars"`
}

MaxLineLengthOption represents the option for the MAX_LINE_LENGTH rule.

type MessageNamesExcludePrepositionsOption added in v0.10.0

type MessageNamesExcludePrepositionsOption struct {
	Prepositions []string `yaml:"prepositions"`
	Excludes     []string `yaml:"excludes"`
}

MessageNamesExcludePrepositionsOption represents the option for the MESSAGE_NAMES_EXCLUDE_PREPOSITIONS rule.

type MessagesHaveCommentOption added in v0.13.0

type MessagesHaveCommentOption struct {
	ShouldFollowGolangStyle bool `yaml:"should_follow_golang_style"`
}

MessagesHaveCommentOption represents the option for the MESSAGES_HAVE_COMMENT rule.

type RPCsHaveCommentOption added in v0.13.0

type RPCsHaveCommentOption struct {
	ShouldFollowGolangStyle bool `yaml:"should_follow_golang_style"`
}

RPCsHaveCommentOption represents the option for the RPCS_HAVE_COMMENT rule.

type Rules

type Rules struct {
	NoDefault  bool     `yaml:"no_default"`
	AllDefault bool     `yaml:"all_default"`
	Add        []string `yaml:"add"`
	Remove     []string `yaml:"remove"`
}

Rules represents the enabled rule set.

type RulesOption

type RulesOption struct {
	FileNamesLowerSnakeCase         FileNamesLowerSnakeCaseOption         `yaml:"file_names_lower_snake_case"`
	ImportsSorted                   ImportsSortedOption                   `yaml:"imports_sorted"`
	MaxLineLength                   MaxLineLengthOption                   `yaml:"max_line_length"`
	Indent                          IndentOption                          `yaml:"indent"`
	EnumFieldNamesZeroValueEndWith  EnumFieldNamesZeroValueEndWithOption  `yaml:"enum_field_names_zero_value_end_with"`
	ServiceNamesEndWith             ServiceNamesEndWithOption             `yaml:"service_names_end_with"`
	FieldNamesExcludePrepositions   FieldNamesExcludePrepositionsOption   `yaml:"field_names_exclude_prepositions"`
	MessageNamesExcludePrepositions MessageNamesExcludePrepositionsOption `yaml:"message_names_exclude_prepositions"`
	MessagesHaveComment             MessagesHaveCommentOption             `yaml:"messages_have_comment"`
	ServicesHaveComment             ServicesHaveCommentOption             `yaml:"services_have_comment"`
	RPCsHaveComment                 RPCsHaveCommentOption                 `yaml:"rpcs_have_comment"`
	FieldsHaveComment               FieldsHaveCommentOption               `yaml:"fields_have_comment"`
	EnumsHaveComment                EnumsHaveCommentOption                `yaml:"enums_have_comment"`
	EnumFieldsHaveComment           EnumFieldsHaveCommentOption           `yaml:"enum_fields_have_comment"`
	SyntaxConsistent                SyntaxConsistentOption                `yaml:"syntax_consistent"`
}

RulesOption represents the option for some rules.

type ServiceNamesEndWithOption added in v0.9.2

type ServiceNamesEndWithOption struct {
	Text string `yaml:"text"`
}

ServiceNamesEndWithOption represents the option for the SERVICE_NAMES_END_WITH rule.

type ServicesHaveCommentOption added in v0.13.0

type ServicesHaveCommentOption struct {
	ShouldFollowGolangStyle bool `yaml:"should_follow_golang_style"`
}

ServicesHaveCommentOption represents the option for the SERVICES_HAVE_COMMENT rule.

type SyntaxConsistentOption added in v0.17.0

type SyntaxConsistentOption struct {
	Version string `yaml:"version"`
}

SyntaxConsistentOption represents the option for the SYNTAX_CONSISTENT rule.

Jump to

Keyboard shortcuts

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