buflintcheck

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package buflintcheck impelements the check functions.

These are used by buflintbuild to create RuleBuilders.

Index

Constants

View Source
const (
	// CommentIgnorePrefix is the comment ignore prefix.
	//
	// Comments with this prefix do not count towards valid comments in the comment checkers.
	// This is also used in buflint when constructing a new Runner, and is passed to the
	// RunnerWithIgnorePrefix option.
	CommentIgnorePrefix = "buf:lint:ignore"
)

Variables

View Source
var (
	// CheckCommentEnum is a check function.
	CheckCommentEnum = newEnumCheckFunc(checkCommentEnum)
	// CheckCommentEnumValue is a check function.
	CheckCommentEnumValue = newEnumValueCheckFunc(checkCommentEnumValue)
	// CheckCommentField is a check function.
	CheckCommentField = newFieldCheckFunc(checkCommentField)
	// CheckCommentMessage is a check function.
	CheckCommentMessage = newMessageCheckFunc(checkCommentMessage)
	// CheckCommentOneof is a check function.
	CheckCommentOneof = newOneofCheckFunc(checkCommentOneof)
	// CheckCommentService is a check function.
	CheckCommentService = newServiceCheckFunc(checkCommentService)
	// CheckCommentRPC is a check function.
	CheckCommentRPC = newMethodCheckFunc(checkCommentRPC)
)
View Source
var (
	// CheckImportNoPublic is a check function.
	CheckImportNoPublic = newFileImportCheckFunc(checkImportNoPublic)
	// CheckImportNoWeak is a check function.
	CheckImportNoWeak = newFileImportCheckFunc(checkImportNoWeak)
	// CheckImportUsed is a check function.
	CheckImportUsed = newFileImportCheckFunc(checkImportUsed)
)
View Source
var (
	// CheckPackageSameCsharpNamespace is a check function.
	CheckPackageSameCsharpNamespace = newPackageToFilesCheckFunc(checkPackageSameCsharpNamespace)
	// CheckPackageSameGoPackage is a check function.
	CheckPackageSameGoPackage = newPackageToFilesCheckFunc(checkPackageSameGoPackage)
	// CheckPackageSameJavaMultipleFiles is a check function.
	CheckPackageSameJavaMultipleFiles = newPackageToFilesCheckFunc(checkPackageSameJavaMultipleFiles)
	// CheckPackageSameJavaPackage is a check function.
	CheckPackageSameJavaPackage = newPackageToFilesCheckFunc(checkPackageSameJavaPackage)
	// CheckPackageSamePhpNamespace is a check function.
	CheckPackageSamePhpNamespace = newPackageToFilesCheckFunc(checkPackageSamePhpNamespace)
	// CheckPackageSameRubyPackage is a check function.
	CheckPackageSameRubyPackage = newPackageToFilesCheckFunc(checkPackageSameRubyPackage)
	// CheckPackageSameSwiftPrefix is a check function.
	CheckPackageSameSwiftPrefix = newPackageToFilesCheckFunc(checkPackageSameSwiftPrefix)
)
View Source
var CheckDirectorySamePackage = newDirToFilesCheckFunc(checkDirectorySamePackage)

CheckDirectorySamePackage is a check function.

View Source
var CheckEnumFirstValueZero = newEnumCheckFunc(checkEnumFirstValueZero)

CheckEnumFirstValueZero is a check function.

View Source
var CheckEnumNoAllowAlias = newEnumCheckFunc(checkEnumNoAllowAlias)

CheckEnumNoAllowAlias is a check function.

View Source
var CheckEnumPascalCase = newEnumCheckFunc(checkEnumPascalCase)

CheckEnumPascalCase is a check function.

View Source
var CheckEnumValuePrefix = newEnumValueCheckFunc(checkEnumValuePrefix)

CheckEnumValuePrefix is a check function.

View Source
var CheckEnumValueUpperSnakeCase = newEnumValueCheckFunc(checkEnumValueUpperSnakeCase)

CheckEnumValueUpperSnakeCase is a check function.

View Source
var CheckEnumZeroValueSuffix = func(
	id string,
	ignoreFunc internal.IgnoreFunc,
	files []protosource.File,
	suffix string,
) ([]bufanalysis.FileAnnotation, error) {
	return newEnumValueCheckFunc(
		func(add addFunc, enumValue protosource.EnumValue) error {
			return checkEnumZeroValueSuffix(add, enumValue, suffix)
		},
	)(id, ignoreFunc, files)
}

CheckEnumZeroValueSuffix is a check function.

View Source
var CheckFieldLowerSnakeCase = newFieldCheckFunc(checkFieldLowerSnakeCase)

CheckFieldLowerSnakeCase is a check function.

View Source
var CheckFieldNoDescriptor = newFieldCheckFunc(checkFieldNoDescriptor)

CheckFieldNoDescriptor is a check function.

View Source
var CheckFileLowerSnakeCase = newFileCheckFunc(checkFileLowerSnakeCase)

CheckFileLowerSnakeCase is a check function.

View Source
var CheckMessagePascalCase = newMessageCheckFunc(checkMessagePascalCase)

CheckMessagePascalCase is a check function.

View Source
var CheckOneofLowerSnakeCase = newOneofCheckFunc(checkOneofLowerSnakeCase)

CheckOneofLowerSnakeCase is a check function.

View Source
var CheckPackageDefined = newFileCheckFunc(checkPackageDefined)

CheckPackageDefined is a check function.

View Source
var CheckPackageDirectoryMatch = newFileCheckFunc(checkPackageDirectoryMatch)

CheckPackageDirectoryMatch is a check function.

View Source
var CheckPackageLowerSnakeCase = newFileCheckFunc(checkPackageLowerSnakeCase)

CheckPackageLowerSnakeCase is a check function.

View Source
var CheckPackageNoImportCycle = newFilesCheckFunc(checkPackageNoImportCycle)

CheckPackageNoImportCycle is a check function.

View Source
var CheckPackageSameDirectory = newPackageToFilesCheckFunc(checkPackageSameDirectory)

CheckPackageSameDirectory is a check function.

View Source
var CheckPackageVersionSuffix = newFileCheckFunc(checkPackageVersionSuffix)

CheckPackageVersionSuffix is a check function.

View Source
var CheckRPCNoClientStreaming = newMethodCheckFunc(checkRPCNoClientStreaming)

CheckRPCNoClientStreaming is a check function.

View Source
var CheckRPCNoServerStreaming = newMethodCheckFunc(checkRPCNoServerStreaming)

CheckRPCNoServerStreaming is a check function.

View Source
var CheckRPCPascalCase = newMethodCheckFunc(checkRPCPascalCase)

CheckRPCPascalCase is a check function.

View Source
var CheckRPCRequestResponseUnique = func(
	id string,
	ignoreFunc internal.IgnoreFunc,
	files []protosource.File,
	allowSameRequestResponse bool,
	allowGoogleProtobufEmptyRequests bool,
	allowGoogleProtobufEmptyResponses bool,
) ([]bufanalysis.FileAnnotation, error) {
	return newFilesCheckFunc(
		func(add addFunc, files []protosource.File) error {
			return checkRPCRequestResponseUnique(
				add,
				files,
				allowSameRequestResponse,
				allowGoogleProtobufEmptyRequests,
				allowGoogleProtobufEmptyResponses,
			)
		},
	)(id, ignoreFunc, files)
}

CheckRPCRequestResponseUnique is a check function.

View Source
var CheckRPCRequestStandardName = func(
	id string,
	ignoreFunc internal.IgnoreFunc,
	files []protosource.File,
	allowGoogleProtobufEmptyRequests bool,
) ([]bufanalysis.FileAnnotation, error) {
	return newMethodCheckFunc(
		func(add addFunc, method protosource.Method) error {
			return checkRPCRequestStandardName(add, method, allowGoogleProtobufEmptyRequests)
		},
	)(id, ignoreFunc, files)
}

CheckRPCRequestStandardName is a check function.

View Source
var CheckRPCResponseStandardName = func(
	id string,
	ignoreFunc internal.IgnoreFunc,
	files []protosource.File,
	allowGoogleProtobufEmptyResponses bool,
) ([]bufanalysis.FileAnnotation, error) {
	return newMethodCheckFunc(
		func(add addFunc, method protosource.Method) error {
			return checkRPCResponseStandardName(add, method, allowGoogleProtobufEmptyResponses)
		},
	)(id, ignoreFunc, files)
}

CheckRPCResponseStandardName is a check function.

View Source
var CheckServicePascalCase = newServiceCheckFunc(checkServicePascalCase)

CheckServicePascalCase is a check function.

View Source
var CheckServiceSuffix = func(
	id string,
	ignoreFunc internal.IgnoreFunc,
	files []protosource.File,
	suffix string,
) ([]bufanalysis.FileAnnotation, error) {
	return newServiceCheckFunc(
		func(add addFunc, service protosource.Service) error {
			return checkServiceSuffix(add, service, suffix)
		},
	)(id, ignoreFunc, files)
}

CheckServiceSuffix is a check function.

View Source
var CheckSyntaxSpecified = newFileCheckFunc(checkSyntaxSpecified)

CheckSyntaxSpecified is a check function.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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