如何通过Gerrits插件在Jenkins中发布多行长评论?
Gerrits插件提交Gerrit评论实现换行的方法
- 在配置字符串中插入转义换行符
\n,指定需要换行的位置,示例代码如下:
noIssuesTitleTemplate : "SonarQube Evaluations.....violations have not been found.\nCodeCOV on New Code: ${codeCoveragePercent}%\nDuplicated Lines on New Code ${codeDuplicates}",
- 若插件支持多行模板字符串(如JavaScript环境),可直接使用反引号包裹字符串并换行编写,示例:
noIssuesTitleTemplate : `SonarQube Evaluations.....violations have not been found. CodeCOV on New Code: ${codeCoveragePercent}% Duplicated Lines on New Code ${codeDuplicates}`,
注:Gerrit默认会解析字符串中的\n为换行,上述两种方法都能让评论在Gerrit中显示为多行。
内容的提问来源于stack exchange,提问作者AhmFM
相关产品推荐
相关产品推荐

