Documentation ¶
Index ¶
- type Directories
- type EnumFieldNamesZeroValueEndWithOption
- type EnumFieldsHaveCommentOption
- type EnumsHaveCommentOption
- type ExternalConfig
- type FieldNamesExcludePrepositionsOption
- type FieldsHaveCommentOption
- type FileNamesLowerSnakeCaseOption
- type Files
- type Ignore
- type Ignores
- type ImportsSortedOption
- type IndentOption
- type Lint
- type MaxLineLengthOption
- type MessageNamesExcludePrepositionsOption
- type MessagesHaveCommentOption
- type RPCsHaveCommentOption
- type Rules
- type RulesOption
- type ServiceNamesEndWithOption
- type ServicesHaveCommentOption
- type SyntaxConsistentOption
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 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 ¶
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 ¶
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.
Source Files ¶
- directories.go
- enumFieldNamesZeroValueEndWithOption.go
- enumFieldsHaveCommentOption.go
- enumsHaveCommentOption.go
- externalConfig.go
- externalConfigProvider.go
- fieldNamesExcludePrepositionsOption.go
- fieldsHaveCommentOption.go
- fileNamesLowerSnakeCaseOption.go
- files.go
- ignore.go
- ignores.go
- importsSortedOption.go
- indentOption.go
- maxLineLengthOption.go
- messageNamesExcludePrepositionsOption.go
- messagesHaveCommentOption.go
- rpcsHaveCommentOption.go
- rules.go
- rulesOption.go
- serviceNamesEndWithOption.go
- servicesHaveCommentOption.go
- syntaxConsistentOption.go