协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
coverage-report【开发与工程】Generate a .NET code coverage report scoped to files changed in the current branch. Runs tests with coverage collection and produces filtered HTML reports.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Generate a code coverage report scoped to source files changed in the current branch compared to a base branch.
Detect the base branch to diff against. Use the MR/PR target branch if known, otherwise default to main or master (whichever exists). Ask the user if ambiguous.
git merge-base --fork-point main HEAD || git merge-base --fork-point master HEAD
git diff <base-branch> --name-only -- '*.cs'
Filter out test files (paths containing Test, Tests, .Tests, .Test).
If no source files changed, stop and inform the user.
Determine which test project(s) to run. Strategies (in order):
MyProject -> MyProject.Tests)rm -rf TestResults/
dotnet test <test-project-or-solution> \
--collect:"XPlat Code Coverage" \
--results-directory ./TestResults/
From the changed file list (step 2), extract basenames and build a filter string:
+*FileName1.cs;+*FileName2.cs;+*FileName3.cs
dotnet reportgenerator \
-reports:"TestResults/**/coverage.cobertura.xml" \
-targetdir:"TestResults/CoverageReport" \
-reporttypes:"Html;TextSummary" \
-filefilters:"<filters>"
TestResults/CoverageReport/Summary.txt to the terminalstart TestResults/CoverageReport/index.htmlopen TestResults/CoverageReport/index.htmlxdg-open TestResults/CoverageReport/index.html-filefilters flag accepts wildcards -- basename matching avoids path sensitivity