Skip to main content
Glama

protolint-mcp

by yoheimuta
failure.go1.26 kB
package report import ( "fmt" "path/filepath" "strings" "github.com/yoheimuta/go-protoparser/v4/parser/meta" ) // Failure represents a lint error information. type Failure struct { pos meta.Position message string ruleID string severity string } // Failuref creates a new Failure and the formatting works like fmt.Sprintf. func Failuref( pos meta.Position, ruleID string, severity string, format string, a ...interface{}, ) Failure { return Failure{ pos: pos, message: fmt.Sprintf(format, a...), ruleID: ruleID, severity: severity, } } // String stringifies Failure. func (f Failure) String() string { return fmt.Sprintf("[%s] %s", f.pos, f.message) } // Message returns a raw message. func (f Failure) Message() string { return f.message } // Pos returns a raw position. func (f Failure) Pos() meta.Position { return f.pos } // RuleID returns a rule ID. func (f Failure) RuleID() string { return f.ruleID } // Severity represents the severity of a severity func (f Failure) Severity() string { return f.severity } // FilenameWithoutExt returns a filename without the extension. func (f Failure) FilenameWithoutExt() string { name := f.pos.Filename return strings.TrimSuffix(name, filepath.Ext(name)) }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yoheimuta/protolint'

If you have feedback or need assistance with the MCP directory API, please join our Discord server