Skip to main content

维护质量代码

了解如何使用 GitHub代码安全性和代码质量功能在存储库中维护高质量的代码。

启用 GitHub Code Quality

在整个组织的存储库中启用 Code Quality ,以大规模识别和修正代码质量问题,帮助你保持一致性并降低操作风险。

禁用 GitHub Code Quality

在该功能正式可用之前,停止 Code Quality 扫描以避免收费。

Rolling out GitHub Code Quality at scale

Bring Code Quality to every team with confidence by piloting on a small group first, then expanding once your quality thresholds are tuned.

为拉取请求设置代码质量阈值

为拉取请求创建 Code Quality 门控,以提高合并到存储库的代码质量。

为存储库设置代码覆盖率

上传测试覆盖率报告,直接查看拉取请求的覆盖率结果,帮助审阅者在合并之前识别未经测试的代码。

限制拉取请求中的代码覆盖率

通过自动阻止低于团队所需的覆盖级别的拉取请求来保护测试覆盖率。

Fixing code quality findings on a pull request

Keep quality issues out of your default branch by applying autofixes, delegating remediation work to Copilot, or dismissing irrelevant findings.

解决拉取请求中的阻塞

找出并解决拉取请求中因代码质量或覆盖率阈值未达标而导致的阻碍,以便合并所做的更改。

Viewing code coverage on pull requests

Review the coverage summary posted on your pull requests to identify files with low or declining code coverage.

Fixing code quality findings in your repository backlog

Generate autofixes for findings on the default branch of your repository, or dismiss findings that aren't relevant.

Fixing code quality findings in recently merged files

Apply autofixes or delegate remediation work to Copilot for quality issues detected by AI-powered analysis of recently merged code.

解读存储库的代码质量评估结果

查看默认分支的 GitHub Code Quality 结果。

Exploring GitHub Code Quality results in your organization

Understand your organization's code health at a glance with the organization-level dashboard for Code Quality.

Viewing and managing GitHub Code Quality costs

Keep your Code Quality spend predictable by seeing exactly where charges come from and using the levers that bring them down.