fix: wrap lines by default
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
6ce54fd3ac
commit
0a51038cb3
1 changed files with 1 additions and 5 deletions
|
@ -17,12 +17,10 @@ func GetSeparatorForMultiline(config *Config) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func FormatComment(config *Config, body string, beenWrapped bool) string {
|
func FormatComment(config *Config, body string, beenWrapped bool) string {
|
||||||
if beenWrapped {
|
|
||||||
if !config.Language.OnSeparateLine {
|
if !config.Language.OnSeparateLine {
|
||||||
body = strings.TrimPrefix(body, config.Language.Continuation)
|
body = strings.TrimPrefix(body, config.Language.Continuation)
|
||||||
}
|
}
|
||||||
body = strings.TrimRightFunc(body, unicode.IsSpace)
|
body = strings.TrimRightFunc(body, unicode.IsSpace)
|
||||||
}
|
|
||||||
return fmt.Sprintf("%s%s%s", config.Language.Opening, body, config.Language.Closing)
|
return fmt.Sprintf("%s%s%s", config.Language.Opening, body, config.Language.Closing)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,9 +28,7 @@ func ProcessComment(config *Config, wrapper *wrap.Wrapper, comment *gitea.PullRe
|
||||||
body := comment.Body
|
body := comment.Body
|
||||||
|
|
||||||
beenWrapped := len(body)+len(config.Language.Opening)+len(config.Language.Closing) > 100
|
beenWrapped := len(body)+len(config.Language.Opening)+len(config.Language.Closing) > 100
|
||||||
if beenWrapped {
|
body = GetSeparatorForMultiline(config) + wrapper.Wrap(body, 100)
|
||||||
body = GetSeparatorForMultiline(config) + wrapper.Wrap(body, 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
body = strings.Replace(body, "\r", "", -1)
|
body = strings.Replace(body, "\r", "", -1)
|
||||||
body = strings.Replace(
|
body = strings.Replace(
|
||||||
|
|
Loading…
Reference in a new issue