rules

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2019 License: MIT Imports: 10 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) Purpose

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) Purpose

func (r EnumNamesUpperCamelCaseRule) Purpose() string

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) Purpose

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) 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) Purpose

func (r MaxLineLengthRule) Purpose() string

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) Purpose

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) Purpose

func (r RPCNamesUpperCamelCaseRule) Purpose() string

Purpose returns the purpose of this rule.

type ServiceNamesEndWithRule added in v0.9.2

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

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

func NewServiceNamesEndWithRule added in v0.9.2

func NewServiceNamesEndWithRule(text string) ServiceNamesEndWithRule

NewServiceNamesEndWithRule creates a new ServiceNamesEndWithRule.

func (ServiceNamesEndWithRule) Apply added in v0.9.2

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

Apply applies the rule to the proto.

func (ServiceNamesEndWithRule) ID added in v0.9.2

ID returns the ID of this rule.

func (ServiceNamesEndWithRule) Purpose added in v0.9.2

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) Purpose

Purpose returns the purpose of this rule.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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