有没有办法将 SonarQube 的覆盖范围作为图标嵌入到 Github 项目中?
Is there a way to embed coverage from SonarQube into a Github project as an icon?
是否可以将代码覆盖率结果(存储在 SonarQube 中)作为可嵌入图标小工具之一嵌入到 Github 项目中(不知道它们的名字是什么;如果有人能告诉我,那就太好了还有)...?例如,我指的是显示构建状态的那些。
目前唯一可用的是this under-development plugin, which was first discussed in this Google Group thread。请注意,该项目似乎还处于起步阶段。
编辑
此插件已发布,可直接从更新中心安装
编辑 2
使用 SonarQube 7.1,徽章成为本机功能。
不再需要使用插件,因为现在添加了一些新的 API,可以满足您的需求。您可以在 .md
文件中使用此代码段:
[![SonarCloud Coverage](https://{domain}/api/project_badges/measure?project={projectName}&metric=coverage)](https://{domain}/component_measures/metric/coverage/list?id={projectName})
请注意,您必须将 {}
中的参数替换为您自己的值。如果您使用本地版本,domain
将是您自己的域,如果您使用云版本,它将是 sonarcloud.io
.
另请注意,这仅适用于 public 个项目。对于私人的,我找不到任何解决方案。
最后作为旁注,metric
参数采用 coverage
以外的一些值,并提供其他您可能会觉得有用的奇妙徽章:
bugs, code_smells, coverage, duplicated_lines_density, ncloc, sqale_rating, alert_status, reliability_rating, security_rating, sqale_index, vulnerabilities
是否可以将代码覆盖率结果(存储在 SonarQube 中)作为可嵌入图标小工具之一嵌入到 Github 项目中(不知道它们的名字是什么;如果有人能告诉我,那就太好了还有)...?例如,我指的是显示构建状态的那些。
目前唯一可用的是this under-development plugin, which was first discussed in this Google Group thread。请注意,该项目似乎还处于起步阶段。
编辑
此插件已发布,可直接从更新中心安装
编辑 2
使用 SonarQube 7.1,徽章成为本机功能。
不再需要使用插件,因为现在添加了一些新的 API,可以满足您的需求。您可以在 .md
文件中使用此代码段:
[![SonarCloud Coverage](https://{domain}/api/project_badges/measure?project={projectName}&metric=coverage)](https://{domain}/component_measures/metric/coverage/list?id={projectName})
请注意,您必须将 {}
中的参数替换为您自己的值。如果您使用本地版本,domain
将是您自己的域,如果您使用云版本,它将是 sonarcloud.io
.
另请注意,这仅适用于 public 个项目。对于私人的,我找不到任何解决方案。
最后作为旁注,metric
参数采用 coverage
以外的一些值,并提供其他您可能会觉得有用的奇妙徽章:
bugs, code_smells, coverage, duplicated_lines_density, ncloc, sqale_rating, alert_status, reliability_rating, security_rating, sqale_index, vulnerabilities