MCPcopy Create free account
hub / github.com/bufbuild/buf / checkCommentLineForCheckIgnore

Function checkCommentLineForCheckIgnore

private/bufpkg/bufcheck/client.go:852–859  ·  view source on GitHub ↗

checkCommentLineForCheckIgnore checks that the comment line starts with the configured comment ignore prefix, a space and the ruleID of the check. All of the following comments are valid, ignoring SERVICE_PASCAL_CASE and this rule only: // buf:lint:ignore SERVICE_PASCAL_CASE, SERVICE_SUFFIX (only

(
	commentLine string,
	commentIgnorePrefix string,
	ruleID string,
)

Source from the content-addressed store, hash-verified

850//
851// // buf:lint:ignoreSERVICE_PASCAL_CASE
852func checkCommentLineForCheckIgnore(
853 commentLine string,
854 commentIgnorePrefix string,
855 ruleID string,
856) bool {
857 fullIgnorePrefix := commentIgnorePrefix + " " + ruleID
858 return strings.HasPrefix(commentLine, fullIgnorePrefix)
859}
860
861type lintOptions struct {
862 pluginConfigs []bufconfig.PluginConfig

Callers 1

ignoreFileLocationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…