Documentation ¶
Overview ¶
Package buflintcheck impelements the check functions.
These are used by buflintbuild to create RuleBuilders.
Index ¶
Constants ¶
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 ¶
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) )
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) )
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) )
var CheckDirectorySamePackage = newDirToFilesCheckFunc(checkDirectorySamePackage)
CheckDirectorySamePackage is a check function.
var CheckEnumFirstValueZero = newEnumCheckFunc(checkEnumFirstValueZero)
CheckEnumFirstValueZero is a check function.
var CheckEnumNoAllowAlias = newEnumCheckFunc(checkEnumNoAllowAlias)
CheckEnumNoAllowAlias is a check function.
var CheckEnumPascalCase = newEnumCheckFunc(checkEnumPascalCase)
CheckEnumPascalCase is a check function.
var CheckEnumValuePrefix = newEnumValueCheckFunc(checkEnumValuePrefix)
CheckEnumValuePrefix is a check function.
var CheckEnumValueUpperSnakeCase = newEnumValueCheckFunc(checkEnumValueUpperSnakeCase)
CheckEnumValueUpperSnakeCase is a check function.
var CheckEnumZeroValueSuffix = func( id string, ignoreFunc internal.IgnoreFunc, files []bufprotosource.File, suffix string, ) ([]bufanalysis.FileAnnotation, error) { return newEnumValueCheckFunc( func(add addFunc, enumValue bufprotosource.EnumValue) error { return checkEnumZeroValueSuffix(add, enumValue, suffix) }, )(id, ignoreFunc, files) }
CheckEnumZeroValueSuffix is a check function.
var CheckFieldLowerSnakeCase = newFieldCheckFunc(checkFieldLowerSnakeCase)
CheckFieldLowerSnakeCase is a check function.
var CheckFieldNoDescriptor = newFieldCheckFunc(checkFieldNoDescriptor)
CheckFieldNoDescriptor is a check function.
var CheckFileLowerSnakeCase = newFileCheckFunc(checkFileLowerSnakeCase)
CheckFileLowerSnakeCase is a check function.
var CheckMessagePascalCase = newMessageCheckFunc(checkMessagePascalCase)
CheckMessagePascalCase is a check function.
var CheckOneofLowerSnakeCase = newOneofCheckFunc(checkOneofLowerSnakeCase)
CheckOneofLowerSnakeCase is a check function.
var CheckPackageDefined = newFileCheckFunc(checkPackageDefined)
CheckPackageDefined is a check function.
var CheckPackageDirectoryMatch = newFileCheckFunc(checkPackageDirectoryMatch)
CheckPackageDirectoryMatch is a check function.
var CheckPackageLowerSnakeCase = newFileCheckFunc(checkPackageLowerSnakeCase)
CheckPackageLowerSnakeCase is a check function.
var CheckPackageNoImportCycle = newFilesWithImportsCheckFunc(checkPackageNoImportCycle)
CheckPackageNoImportCycle is a check function.
Note that imports are not skipped via the helper, as we want to detect import cycles even if they are within imports, and report on them. If a non-import is part of an import cycle, we report it, even if the import cycle includes imports in it.
var CheckPackageSameDirectory = newPackageToFilesCheckFunc(checkPackageSameDirectory)
CheckPackageSameDirectory is a check function.
var CheckPackageVersionSuffix = newFileCheckFunc(checkPackageVersionSuffix)
CheckPackageVersionSuffix is a check function.
var CheckProtovalidate = combine(
newMessageCheckFunc(checkProtovalidateMessage),
newFieldCheckFunc(checkProtovalidateField),
)
CheckProtovalidate is a check function.
var CheckRPCNoClientStreaming = newMethodCheckFunc(checkRPCNoClientStreaming)
CheckRPCNoClientStreaming is a check function.
var CheckRPCNoServerStreaming = newMethodCheckFunc(checkRPCNoServerStreaming)
CheckRPCNoServerStreaming is a check function.
var CheckRPCPascalCase = newMethodCheckFunc(checkRPCPascalCase)
CheckRPCPascalCase is a check function.
var CheckRPCRequestResponseUnique = func( id string, ignoreFunc internal.IgnoreFunc, files []bufprotosource.File, allowSameRequestResponse bool, allowGoogleProtobufEmptyRequests bool, allowGoogleProtobufEmptyResponses bool, ) ([]bufanalysis.FileAnnotation, error) { return newFilesCheckFunc( func(add addFunc, files []bufprotosource.File) error { return checkRPCRequestResponseUnique( add, files, allowSameRequestResponse, allowGoogleProtobufEmptyRequests, allowGoogleProtobufEmptyResponses, ) }, )(id, ignoreFunc, files) }
CheckRPCRequestResponseUnique is a check function.
var CheckRPCRequestStandardName = func( id string, ignoreFunc internal.IgnoreFunc, files []bufprotosource.File, allowGoogleProtobufEmptyRequests bool, ) ([]bufanalysis.FileAnnotation, error) { return newMethodCheckFunc( func(add addFunc, method bufprotosource.Method) error { return checkRPCRequestStandardName(add, method, allowGoogleProtobufEmptyRequests) }, )(id, ignoreFunc, files) }
CheckRPCRequestStandardName is a check function.
var CheckRPCResponseStandardName = func( id string, ignoreFunc internal.IgnoreFunc, files []bufprotosource.File, allowGoogleProtobufEmptyResponses bool, ) ([]bufanalysis.FileAnnotation, error) { return newMethodCheckFunc( func(add addFunc, method bufprotosource.Method) error { return checkRPCResponseStandardName(add, method, allowGoogleProtobufEmptyResponses) }, )(id, ignoreFunc, files) }
CheckRPCResponseStandardName is a check function.
var CheckServicePascalCase = newServiceCheckFunc(checkServicePascalCase)
CheckServicePascalCase is a check function.
var CheckServiceSuffix = func( id string, ignoreFunc internal.IgnoreFunc, files []bufprotosource.File, suffix string, ) ([]bufanalysis.FileAnnotation, error) { return newServiceCheckFunc( func(add addFunc, service bufprotosource.Service) error { return checkServiceSuffix(add, service, suffix) }, )(id, ignoreFunc, files) }
CheckServiceSuffix is a check function.
var CheckSyntaxSpecified = newFileCheckFunc(checkSyntaxSpecified)
CheckSyntaxSpecified is a check function.
Functions ¶
This section is empty.
Types ¶
This section is empty.