MCPcopy Create free account
hub / github.com/github/gh-aw / stripDetailLinePrefix

Function stripDetailLinePrefix

pkg/parser/schema_compiler.go:341–343  ·  view source on GitHub ↗

stripDetailLinePrefix removes the "'path' (line N, col M): " prefix from a formatSchemaFailureDetail result. This prefix is redundant for single-failure errors because the IDE-compatible "file:line:col: error:" header already encodes the position; stripping it avoids the information appearing twice

(detail string)

Source from the content-addressed store, hash-verified

339// errors because the IDE-compatible "file:line:col: error:" header already encodes
340// the position; stripping it avoids the information appearing twice to the user.
341func stripDetailLinePrefix(detail string) string {
342 return pathPositionPrefixPattern.ReplaceAllString(detail, "")
343}
344
345// validateWithSchemaAndLocation validates frontmatter against a JSON schema with location information
346func validateWithSchemaAndLocation(frontmatter map[string]any, schemaJSON, context, filePath string) error {

Callers 2

Calls

no outgoing calls

Tested by 1