MCPcopy Index your code
hub / github.com/nikivdev/go / splitCommitMessageParagraphs

Function splitCommitMessageParagraphs

cli/flow/main.go:2954–2976  ·  view source on GitHub ↗
(message string)

Source from the content-addressed store, hash-verified

2952}
2953
2954func splitCommitMessageParagraphs(message string) []string {
2955 lines := strings.Split(message, "\n")
2956 var paragraphs []string
2957 var current []string
2958
2959 for _, line := range lines {
2960 if strings.TrimSpace(line) == "" {
2961 if len(current) > 0 {
2962 paragraphs = append(paragraphs, strings.Join(current, "\n"))
2963 current = nil
2964 }
2965 continue
2966 }
2967
2968 current = append(current, strings.TrimRight(line, " \t"))
2969 }
2970
2971 if len(current) > 0 {
2972 paragraphs = append(paragraphs, strings.Join(current, "\n"))
2973 }
2974
2975 return paragraphs
2976}
2977
2978func trimMatchingQuotes(message string) string {
2979 if len(message) >= 2 {

Callers 2

runCommitReviewAndPushFunction · 0.85
prepareCommitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected