MCPcopy Create free account
hub / github.com/vale-cli/vale / addSourceLine

Function addSourceLine

internal/lint/code/comments.go:35–49  ·  view source on GitHub ↗
(line string, atEnd bool)

Source from the content-addressed store, hash-verified

33}
34
35func addSourceLine(line string, atEnd bool) string {
36 if line == "" {
37 return "\n\n"
38 }
39
40 if !strings.HasPrefix(line, "\n") && !atEnd {
41 line = strings.TrimLeft(line, " ")
42 line = fmt.Sprintf("\n%s", line)
43 } else if !strings.HasSuffix(line, "\n") && atEnd {
44 line = strings.TrimLeft(line, " ")
45 line = fmt.Sprintf("%s\n", line)
46 }
47
48 return line
49}
50
51func coalesce(comments []Comment) []Comment {
52 var joined []Comment

Callers 1

coalesceFunction · 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…