You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.26 05:32:34