(ctx frontmatterContextData, adjustedLine int)
| 427 | } |
| 428 | |
| 429 | func buildAdjustedContextLines(ctx frontmatterContextData, adjustedLine int) []string { |
| 430 | if len(ctx.allLines) == 0 { |
| 431 | return ctx.contextLines |
| 432 | } |
| 433 | var adjustedContextLines []string |
| 434 | contextSize := 7 |
| 435 | expectedFirstLine := adjustedLine - contextSize/2 |
| 436 | fileStart := max(0, expectedFirstLine-1) |
| 437 | for lineNum := expectedFirstLine; lineNum < 1; lineNum++ { |
| 438 | adjustedContextLines = append(adjustedContextLines, "") |
| 439 | } |
| 440 | fileEnd := min(len(ctx.allLines), fileStart+contextSize-len(adjustedContextLines)) |
| 441 | for i := fileStart; i < fileEnd; i++ { |
| 442 | adjustedContextLines = append(adjustedContextLines, ctx.allLines[i]) |
| 443 | } |
| 444 | if len(adjustedContextLines) == 0 { |
| 445 | return ctx.contextLines |
| 446 | } |
| 447 | return adjustedContextLines |
| 448 | } |
| 449 | |
| 450 | func formatSchemaDetailMessage(detailLines []string) string { |
| 451 | message := stripDetailLinePrefix(detailLines[0]) |
no outgoing calls
no test coverage detected