rules

package
v0.25.3-crie Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnumFieldNamesUpperSnakeCaseRule

type EnumFieldNamesUpperSnakeCaseRule struct{}

EnumFieldNamesUpperSnakeCaseRule verifies that all enum field names are CAPITALS_WITH_UNDERSCORES. See https://developers.google.com/protocol-buffers/docs/style#enums.

func NewEnumFieldNamesUpperSnakeCaseRule

func NewEnumFieldNamesUpperSnakeCaseRule() EnumFieldNamesUpperSnakeCaseRule

NewEnumFieldNamesUpperSnakeCaseRule creates a new EnumFieldNamesUpperSnakeCaseRule.

func (EnumFieldNamesUpperSnakeCaseRule) Apply

Apply applies the rule to the proto.

func (EnumFieldNamesUpperSnakeCaseRule) ID

ID returns the ID of this rule.

func (EnumFieldNamesUpperSnakeCaseRule) IsOfficial

func (r EnumFieldNamesUpperSnakeCaseRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (EnumFieldNamesUpperSnakeCaseRule) Purpose

Purpose returns the purpose of this rule.

type EnumFieldNamesZeroValueEndWithRule

type EnumFieldNamesZeroValueEndWithRule struct {
	// contains filtered or unexported fields
}

EnumFieldNamesZeroValueEndWithRule verifies that the zero value enum should have the suffix (e.g. "UNSPECIFIED", "INVALID"). See https://developers.google.com/protocol-buffers/docs/style#enums.

func NewEnumFieldNamesZeroValueEndWithRule

func NewEnumFieldNamesZeroValueEndWithRule(
	suffix string,
) EnumFieldNamesZeroValueEndWithRule

NewEnumFieldNamesZeroValueEndWithRule creates a new EnumFieldNamesZeroValueEndWithRule.

func (EnumFieldNamesZeroValueEndWithRule) Apply

Apply applies the rule to the proto.

func (EnumFieldNamesZeroValueEndWithRule) ID

ID returns the ID of this rule.

func (EnumFieldNamesZeroValueEndWithRule) IsOfficial

IsOfficial decides whether or not this rule belongs to the official guide.

func (EnumFieldNamesZeroValueEndWithRule) Purpose

Purpose returns the purpose of this rule.

type EnumFieldsHaveCommentRule

type EnumFieldsHaveCommentRule struct {
	// contains filtered or unexported fields
}

EnumFieldsHaveCommentRule verifies that all enumFields have a comment.

func NewEnumFieldsHaveCommentRule

func NewEnumFieldsHaveCommentRule(
	shouldFollowGolangStyle bool,
) EnumFieldsHaveCommentRule

NewEnumFieldsHaveCommentRule creates a new EnumFieldsHaveCommentRule.

func (EnumFieldsHaveCommentRule) Apply

Apply applies the rule to the proto.

func (EnumFieldsHaveCommentRule) ID

ID returns the ID of this rule.

func (EnumFieldsHaveCommentRule) IsOfficial

func (r EnumFieldsHaveCommentRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (EnumFieldsHaveCommentRule) Purpose

func (r EnumFieldsHaveCommentRule) Purpose() string

Purpose returns the purpose of this rule.

type EnumNamesUpperCamelCaseRule

type EnumNamesUpperCamelCaseRule struct{}

EnumNamesUpperCamelCaseRule verifies that all enum names are CamelCase (with an initial capital). See https://developers.google.com/protocol-buffers/docs/style#enums.

func NewEnumNamesUpperCamelCaseRule

func NewEnumNamesUpperCamelCaseRule() EnumNamesUpperCamelCaseRule

NewEnumNamesUpperCamelCaseRule creates a new EnumNamesUpperCamelCaseRule.

func (EnumNamesUpperCamelCaseRule) Apply

Apply applies the rule to the proto.

func (EnumNamesUpperCamelCaseRule) ID

ID returns the ID of this rule.

func (EnumNamesUpperCamelCaseRule) IsOfficial

func (r EnumNamesUpperCamelCaseRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (EnumNamesUpperCamelCaseRule) Purpose

func (r EnumNamesUpperCamelCaseRule) Purpose() string

Purpose returns the purpose of this rule.

type EnumsHaveCommentRule

type EnumsHaveCommentRule struct {
	// contains filtered or unexported fields
}

EnumsHaveCommentRule verifies that all enums have a comment.

func NewEnumsHaveCommentRule

func NewEnumsHaveCommentRule(
	shouldFollowGolangStyle bool,
) EnumsHaveCommentRule

NewEnumsHaveCommentRule creates a new EnumsHaveCommentRule.

func (EnumsHaveCommentRule) Apply

func (r EnumsHaveCommentRule) Apply(proto *parser.Proto) ([]report.Failure, error)

Apply applies the rule to the proto.

func (EnumsHaveCommentRule) ID

ID returns the ID of this rule.

func (EnumsHaveCommentRule) IsOfficial

func (r EnumsHaveCommentRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (EnumsHaveCommentRule) Purpose

func (r EnumsHaveCommentRule) Purpose() string

Purpose returns the purpose of this rule.

type FieldNamesExcludePrepositionsRule

type FieldNamesExcludePrepositionsRule struct {
	// contains filtered or unexported fields
}

FieldNamesExcludePrepositionsRule verifies that all field names don't include prepositions (e.g. "for", "during", "at"). It is assumed that the field names are underscore_separated_names. See https://cloud.google.com/apis/design/naming_convention#field_names.

func NewFieldNamesExcludePrepositionsRule

func NewFieldNamesExcludePrepositionsRule(
	prepositions []string,
	excludes []string,
) FieldNamesExcludePrepositionsRule

NewFieldNamesExcludePrepositionsRule creates a new FieldNamesExcludePrepositionsRule.

func (FieldNamesExcludePrepositionsRule) Apply

Apply applies the rule to the proto.

func (FieldNamesExcludePrepositionsRule) ID

ID returns the ID of this rule.

func (FieldNamesExcludePrepositionsRule) IsOfficial

func (r FieldNamesExcludePrepositionsRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (FieldNamesExcludePrepositionsRule) Purpose

Purpose returns the purpose of this rule.

type FieldNamesLowerSnakeCaseRule

type FieldNamesLowerSnakeCaseRule struct{}

FieldNamesLowerSnakeCaseRule verifies that all field names are underscore_separated_names. See https://developers.google.com/protocol-buffers/docs/style#message-and-field-names.

func NewFieldNamesLowerSnakeCaseRule

func NewFieldNamesLowerSnakeCaseRule() FieldNamesLowerSnakeCaseRule

NewFieldNamesLowerSnakeCaseRule creates a new FieldNamesLowerSnakeCaseRule.

func (FieldNamesLowerSnakeCaseRule) Apply

Apply applies the rule to the proto.

func (FieldNamesLowerSnakeCaseRule) ID

ID returns the ID of this rule.

func (FieldNamesLowerSnakeCaseRule) IsOfficial

func (r FieldNamesLowerSnakeCaseRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (FieldNamesLowerSnakeCaseRule) Purpose

Purpose returns the purpose of this rule.

type FieldsHaveCommentRule

type FieldsHaveCommentRule struct {
	// contains filtered or unexported fields
}

FieldsHaveCommentRule verifies that all fields have a comment.

func NewFieldsHaveCommentRule

func NewFieldsHaveCommentRule(
	shouldFollowGolangStyle bool,
) FieldsHaveCommentRule

NewFieldsHaveCommentRule creates a new FieldsHaveCommentRule.

func (FieldsHaveCommentRule) Apply

func (r FieldsHaveCommentRule) Apply(proto *parser.Proto) ([]report.Failure, error)

Apply applies the rule to the proto.

func (FieldsHaveCommentRule) ID

ID returns the ID of this rule.

func (FieldsHaveCommentRule) IsOfficial

func (r FieldsHaveCommentRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (FieldsHaveCommentRule) Purpose

func (r FieldsHaveCommentRule) Purpose() string

Purpose returns the purpose of this rule.

type FileNamesLowerSnakeCaseRule

type FileNamesLowerSnakeCaseRule struct {
	// contains filtered or unexported fields
}

FileNamesLowerSnakeCaseRule verifies that all file names are lower_snake_case.proto. See https://developers.google.com/protocol-buffers/docs/style#file-structure.

func NewFileNamesLowerSnakeCaseRule

func NewFileNamesLowerSnakeCaseRule(
	excluded []string,
) FileNamesLowerSnakeCaseRule

NewFileNamesLowerSnakeCaseRule creates a new FileNamesLowerSnakeCaseRule.

func (FileNamesLowerSnakeCaseRule) Apply

Apply applies the rule to the proto.

func (FileNamesLowerSnakeCaseRule) ID

ID returns the ID of this rule.

func (FileNamesLowerSnakeCaseRule) IsOfficial

func (r FileNamesLowerSnakeCaseRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (FileNamesLowerSnakeCaseRule) Purpose

func (r FileNamesLowerSnakeCaseRule) Purpose() string

Purpose returns the purpose of this rule.

type ImportsSortedRule

type ImportsSortedRule struct {
	// contains filtered or unexported fields
}

ImportsSortedRule enforces sorted imports.

func NewImportsSortedRule

func NewImportsSortedRule(
	newline string,
	fixMode bool,
) ImportsSortedRule

NewImportsSortedRule creates a new ImportsSortedRule.

func (ImportsSortedRule) Apply

func (r ImportsSortedRule) Apply(
	proto *parser.Proto,
) ([]report.Failure, error)

Apply applies the rule to the proto.

func (ImportsSortedRule) ID

func (r ImportsSortedRule) ID() string

ID returns the ID of this rule.

func (ImportsSortedRule) IsOfficial

func (r ImportsSortedRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (ImportsSortedRule) Purpose

func (r ImportsSortedRule) Purpose() string

Purpose returns the purpose of this rule.

type IndentRule

type IndentRule struct {
	// contains filtered or unexported fields
}

IndentRule enforces a consistent indentation style.

func NewIndentRule

func NewIndentRule(
	style string,
	newline string,
	fixMode bool,
) IndentRule

NewIndentRule creates a new IndentRule.

func (IndentRule) Apply

func (r IndentRule) Apply(
	proto *parser.Proto,
) ([]report.Failure, error)

Apply applies the rule to the proto.

func (IndentRule) ID

func (r IndentRule) ID() string

ID returns the ID of this rule.

func (IndentRule) IsOfficial

func (r IndentRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (IndentRule) Purpose

func (r IndentRule) Purpose() string

Purpose returns the purpose of this rule.

type MaxLineLengthRule

type MaxLineLengthRule struct {
	// contains filtered or unexported fields
}

MaxLineLengthRule enforces a maximum line length to increase code readability and maintainability. The length of a line is defined as the number of Unicode characters in the line.

func NewMaxLineLengthRule

func NewMaxLineLengthRule(
	maxChars int,
	tabChars int,
) MaxLineLengthRule

NewMaxLineLengthRule creates a new MaxLineLengthRule.

func (MaxLineLengthRule) Apply

func (r MaxLineLengthRule) Apply(proto *parser.Proto) (
	failures []report.Failure,
	err error,
)

Apply applies the rule to the proto.

func (MaxLineLengthRule) ID

func (r MaxLineLengthRule) ID() string

ID returns the ID of this rule.

func (MaxLineLengthRule) IsOfficial

func (r MaxLineLengthRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (MaxLineLengthRule) Purpose

func (r MaxLineLengthRule) Purpose() string

Purpose returns the purpose of this rule.

type MessageNamesExcludePrepositionsRule

type MessageNamesExcludePrepositionsRule struct {
	// contains filtered or unexported fields
}

MessageNamesExcludePrepositionsRule verifies that all message names don't include prepositions (e.g. "With", "For"). It is assumed that the message names are CamelCase (with an initial capital). See https://cloud.google.com/apis/design/naming_convention#message_names.

func NewMessageNamesExcludePrepositionsRule

func NewMessageNamesExcludePrepositionsRule(
	prepositions []string,
	excludes []string,
) MessageNamesExcludePrepositionsRule

NewMessageNamesExcludePrepositionsRule creates a new MessageNamesExcludePrepositionsRule.

func (MessageNamesExcludePrepositionsRule) Apply

Apply applies the rule to the proto.

func (MessageNamesExcludePrepositionsRule) ID

ID returns the ID of this rule.

func (MessageNamesExcludePrepositionsRule) IsOfficial

IsOfficial decides whether or not this rule belongs to the official guide.

func (MessageNamesExcludePrepositionsRule) Purpose

Purpose returns the purpose of this rule.

type MessageNamesUpperCamelCaseRule

type MessageNamesUpperCamelCaseRule struct{}

MessageNamesUpperCamelCaseRule verifies that all message names are CamelCase (with an initial capital). See https://developers.google.com/protocol-buffers/docs/style#message-and-field-names.

func NewMessageNamesUpperCamelCaseRule

func NewMessageNamesUpperCamelCaseRule() MessageNamesUpperCamelCaseRule

NewMessageNamesUpperCamelCaseRule creates a new MessageNamesUpperCamelCaseRule.

func (MessageNamesUpperCamelCaseRule) Apply

Apply applies the rule to the proto.

func (MessageNamesUpperCamelCaseRule) ID

ID returns the ID of this rule.

func (MessageNamesUpperCamelCaseRule) IsOfficial

func (r MessageNamesUpperCamelCaseRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (MessageNamesUpperCamelCaseRule) Purpose

Purpose returns the purpose of this rule.

type MessagesHaveCommentRule

type MessagesHaveCommentRule struct {
	// contains filtered or unexported fields
}

MessagesHaveCommentRule verifies that all messages have a comment.

func NewMessagesHaveCommentRule

func NewMessagesHaveCommentRule(
	shouldFollowGolangStyle bool,
) MessagesHaveCommentRule

NewMessagesHaveCommentRule creates a new MessagesHaveCommentRule.

func (MessagesHaveCommentRule) Apply

func (r MessagesHaveCommentRule) Apply(proto *parser.Proto) ([]report.Failure, error)

Apply applies the rule to the proto.

func (MessagesHaveCommentRule) ID

ID returns the ID of this rule.

func (MessagesHaveCommentRule) IsOfficial

func (r MessagesHaveCommentRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (MessagesHaveCommentRule) Purpose

func (r MessagesHaveCommentRule) Purpose() string

Purpose returns the purpose of this rule.

type OrderRule

type OrderRule struct{}

OrderRule verifies that all files should be ordered in the following manner: 1. Syntax 2. Package 3. Imports (sorted) 4. File options 5. Everything else See https://developers.google.com/protocol-buffers/docs/style#file-structure.

func NewOrderRule

func NewOrderRule() OrderRule

NewOrderRule creates a new OrderRule.

func (OrderRule) Apply

func (r OrderRule) Apply(proto *parser.Proto) ([]report.Failure, error)

Apply applies the rule to the proto.

func (OrderRule) ID

func (r OrderRule) ID() string

ID returns the ID of this rule.

func (OrderRule) IsOfficial

func (r OrderRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (OrderRule) Purpose

func (r OrderRule) Purpose() string

Purpose returns the purpose of this rule.

type PackageNameLowerCaseRule

type PackageNameLowerCaseRule struct{}

PackageNameLowerCaseRule verifies that the package name only contains lowercase letters, digits and/or periods. See https://developers.google.com/protocol-buffers/docs/style#packages.

func NewPackageNameLowerCaseRule

func NewPackageNameLowerCaseRule() PackageNameLowerCaseRule

NewPackageNameLowerCaseRule creates a new PackageNameLowerCaseRule.

func (PackageNameLowerCaseRule) Apply

Apply applies the rule to the proto.

func (PackageNameLowerCaseRule) ID

ID returns the ID of this rule.

func (PackageNameLowerCaseRule) IsOfficial

func (r PackageNameLowerCaseRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (PackageNameLowerCaseRule) Purpose

func (r PackageNameLowerCaseRule) Purpose() string

Purpose returns the purpose of this rule.

type Proto3FieldsAvoidRequiredRule

type Proto3FieldsAvoidRequiredRule struct {
}

Proto3FieldsAvoidRequiredRule verifies that all fields should avoid required for proto3. See https://developers.google.com/protocol-buffers/docs/style#things-to-avoid

func NewProto3FieldsAvoidRequiredRule

func NewProto3FieldsAvoidRequiredRule() Proto3FieldsAvoidRequiredRule

NewProto3FieldsAvoidRequiredRule creates a new Proto3FieldsAvoidRequiredRule.

func (Proto3FieldsAvoidRequiredRule) Apply

Apply applies the rule to the proto.

func (Proto3FieldsAvoidRequiredRule) ID

ID returns the ID of this rule.

func (Proto3FieldsAvoidRequiredRule) IsOfficial

func (r Proto3FieldsAvoidRequiredRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (Proto3FieldsAvoidRequiredRule) Purpose

Purpose returns the purpose of this rule.

type Proto3GroupsAvoidRule

type Proto3GroupsAvoidRule struct {
}

Proto3GroupsAvoidRule verifies that all groups should be avoided for proto3. See https://developers.google.com/protocol-buffers/docs/style#things-to-avoid

func NewProto3GroupsAvoidRule

func NewProto3GroupsAvoidRule() Proto3GroupsAvoidRule

NewProto3GroupsAvoidRule creates a new Proto3GroupsAvoidRule.

func (Proto3GroupsAvoidRule) Apply

func (r Proto3GroupsAvoidRule) Apply(proto *parser.Proto) ([]report.Failure, error)

Apply applies the rule to the proto.

func (Proto3GroupsAvoidRule) ID

ID returns the ID of this rule.

func (Proto3GroupsAvoidRule) IsOfficial

func (r Proto3GroupsAvoidRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (Proto3GroupsAvoidRule) Purpose

func (r Proto3GroupsAvoidRule) Purpose() string

Purpose returns the purpose of this rule.

type RPCNamesUpperCamelCaseRule

type RPCNamesUpperCamelCaseRule struct{}

RPCNamesUpperCamelCaseRule verifies that all rpc names are CamelCase (with an initial capital). See https://developers.google.com/protocol-buffers/docs/style#services.

func NewRPCNamesUpperCamelCaseRule

func NewRPCNamesUpperCamelCaseRule() RPCNamesUpperCamelCaseRule

NewRPCNamesUpperCamelCaseRule creates a new RPCNamesUpperCamelCaseRule.

func (RPCNamesUpperCamelCaseRule) Apply

Apply applies the rule to the proto.

func (RPCNamesUpperCamelCaseRule) ID

ID returns the ID of this rule.

func (RPCNamesUpperCamelCaseRule) IsOfficial

func (r RPCNamesUpperCamelCaseRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (RPCNamesUpperCamelCaseRule) Purpose

func (r RPCNamesUpperCamelCaseRule) Purpose() string

Purpose returns the purpose of this rule.

type RPCsHaveCommentRule

type RPCsHaveCommentRule struct {
	// contains filtered or unexported fields
}

RPCsHaveCommentRule verifies that all rpcs have a comment.

func NewRPCsHaveCommentRule

func NewRPCsHaveCommentRule(
	shouldFollowGolangStyle bool,
) RPCsHaveCommentRule

NewRPCsHaveCommentRule creates a new RPCsHaveCommentRule.

func (RPCsHaveCommentRule) Apply

func (r RPCsHaveCommentRule) Apply(proto *parser.Proto) ([]report.Failure, error)

Apply applies the rule to the proto.

func (RPCsHaveCommentRule) ID

func (r RPCsHaveCommentRule) ID() string

ID returns the ID of this rule.

func (RPCsHaveCommentRule) IsOfficial

func (r RPCsHaveCommentRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (RPCsHaveCommentRule) Purpose

func (r RPCsHaveCommentRule) Purpose() string

Purpose returns the purpose of this rule.

type RepeatedFieldNamesPluralizedRule

type RepeatedFieldNamesPluralizedRule struct {
	// contains filtered or unexported fields
}

RepeatedFieldNamesPluralizedRule verifies that repeated field names are pluralized names. See https://developers.google.com/protocol-buffers/docs/style#repeated-fields.

func NewRepeatedFieldNamesPluralizedRule

func NewRepeatedFieldNamesPluralizedRule(
	pluralRules map[string]string,
	singularRules map[string]string,
	uncountableRules []string,
	irregularRules map[string]string,
) RepeatedFieldNamesPluralizedRule

NewRepeatedFieldNamesPluralizedRule creates a new RepeatedFieldNamesPluralizedRule.

func (RepeatedFieldNamesPluralizedRule) Apply

Apply applies the rule to the proto.

func (RepeatedFieldNamesPluralizedRule) ID

ID returns the ID of this rule.

func (RepeatedFieldNamesPluralizedRule) IsOfficial

func (r RepeatedFieldNamesPluralizedRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (RepeatedFieldNamesPluralizedRule) Purpose

Purpose returns the purpose of this rule.

type ServiceNamesEndWithRule

type ServiceNamesEndWithRule struct {
	// contains filtered or unexported fields
}

ServiceNamesEndWithRule verifies that all service names end with the specified value.

func NewServiceNamesEndWithRule

func NewServiceNamesEndWithRule(text string) ServiceNamesEndWithRule

NewServiceNamesEndWithRule creates a new ServiceNamesEndWithRule.

func (ServiceNamesEndWithRule) Apply

func (r ServiceNamesEndWithRule) Apply(proto *parser.Proto) ([]report.Failure, error)

Apply applies the rule to the proto.

func (ServiceNamesEndWithRule) ID

ID returns the ID of this rule.

func (ServiceNamesEndWithRule) IsOfficial

func (r ServiceNamesEndWithRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (ServiceNamesEndWithRule) Purpose

func (r ServiceNamesEndWithRule) Purpose() string

Purpose returns the purpose of this rule.

type ServiceNamesUpperCamelCaseRule

type ServiceNamesUpperCamelCaseRule struct{}

ServiceNamesUpperCamelCaseRule verifies that all service names are CamelCase (with an initial capital). See https://developers.google.com/protocol-buffers/docs/style#services.

func NewServiceNamesUpperCamelCaseRule

func NewServiceNamesUpperCamelCaseRule() ServiceNamesUpperCamelCaseRule

NewServiceNamesUpperCamelCaseRule creates a new ServiceNamesUpperCamelCaseRule.

func (ServiceNamesUpperCamelCaseRule) Apply

Apply applies the rule to the proto.

func (ServiceNamesUpperCamelCaseRule) ID

ID returns the ID of this rule.

func (ServiceNamesUpperCamelCaseRule) IsOfficial

func (r ServiceNamesUpperCamelCaseRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (ServiceNamesUpperCamelCaseRule) Purpose

Purpose returns the purpose of this rule.

type ServicesHaveCommentRule

type ServicesHaveCommentRule struct {
	// contains filtered or unexported fields
}

ServicesHaveCommentRule verifies that all services have a comment.

func NewServicesHaveCommentRule

func NewServicesHaveCommentRule(
	shouldFollowGolangStyle bool,
) ServicesHaveCommentRule

NewServicesHaveCommentRule creates a new ServicesHaveCommentRule.

func (ServicesHaveCommentRule) Apply

func (r ServicesHaveCommentRule) Apply(proto *parser.Proto) ([]report.Failure, error)

Apply applies the rule to the proto.

func (ServicesHaveCommentRule) ID

ID returns the ID of this rule.

func (ServicesHaveCommentRule) IsOfficial

func (r ServicesHaveCommentRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (ServicesHaveCommentRule) Purpose

func (r ServicesHaveCommentRule) Purpose() string

Purpose returns the purpose of this rule.

type SyntaxConsistentRule

type SyntaxConsistentRule struct {
	// contains filtered or unexported fields
}

SyntaxConsistentRule verifies that syntax is a specified version.

func NewSyntaxConsistentRule

func NewSyntaxConsistentRule(
	version string,
) SyntaxConsistentRule

NewSyntaxConsistentRule creates a new SyntaxConsistentRule.

func (SyntaxConsistentRule) Apply

func (r SyntaxConsistentRule) Apply(proto *parser.Proto) ([]report.Failure, error)

Apply applies the rule to the proto.

func (SyntaxConsistentRule) ID

ID returns the ID of this rule.

func (SyntaxConsistentRule) IsOfficial

func (r SyntaxConsistentRule) IsOfficial() bool

IsOfficial decides whether or not this rule belongs to the official guide.

func (SyntaxConsistentRule) Purpose

func (r SyntaxConsistentRule) Purpose() string

Purpose returns the purpose of this rule.

Jump to

Keyboard shortcuts

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