From 0c507f598388e9b6b02bb3774e0eb66214c3c7c3 Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Tue, 22 Aug 2023 18:44:17 +0900 Subject: [PATCH] chore: add code coverage exclusions --- src/Docfx.Common/Git/GitUtility.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Docfx.Common/Git/GitUtility.cs b/src/Docfx.Common/Git/GitUtility.cs index 70e4411a0f6..2af47c402cc 100644 --- a/src/Docfx.Common/Git/GitUtility.cs +++ b/src/Docfx.Common/Git/GitUtility.cs @@ -267,7 +267,7 @@ private static GitRepoInfo GetRepoInfoCore(string directory) return repoInfo; } - [ExcludeFromCodeCoverage] + [ExcludeFromCodeCoverage(Justification = "To avoid Codecov report indirect coverage changes")] private static Tuple GetBranchNames(string repoRootPath) { // Use the branch name specified by the environment variable. @@ -305,6 +305,7 @@ private static Tuple GetBranchNames(string repoRootPath) // Many build systems use a "detached head", which means that the normal git commands // to get branch names do not work. Thankfully, they set an environment variable. + [ExcludeFromCodeCoverage(Justification = "To avoid Codecov report indirect coverage changes")] private static Tuple GetBranchNamesFromDetachedHead(string repoRootPath) { foreach (var name in BuildSystemBranchName)