Add --verbosity diagnostic flag option for debugging "Error: No files found matching glob pattern."
Like others https://github.com/irongut/CodeCoverageSummary/issues/268, I have no idea why this suddenly started happening in my GitHub Actions. It worked, and now every build since has been breaking, and I am wasting time trying to find out why.
https://github.com/irongut/CodeCoverageSummary/blob/f13848964841ca2f7a63343b287493e17dc645de/src/CodeCoverageSummary/Program.cs#L31
This is extremely hard to debug. Unfortunately, Microsoft.Extensions.FileSystemGlobbing does not directly dump the contents of each file it evaluates.
Proposed fix would be:
CommandLineOptions.cs
[Option(longName: "verbosity", Required = false, HelpText = "Logging level - diagnostic or none", Default = "none")]
public string Verbosity { get; set; } = "none";
if (matchingFiles?.Any() == false)
{
if (string.Equals(o.Verbosity, "diagnostic", StringComparison.OrdinalIgnoreCase))
{
Matcher matcher = new();
IEnumerable<string> matchingFiles = matcher.GetResultsInFullPath(".");
Console.WriteLine($"Files available in search path: {string.Join(Environment.NewLine, matchingFiles)}");
}
Console.WriteLine("Error: No files found matching glob pattern.");
return -2; // error
}
@irongut Can you let me know if you plan to accept and publish, or if I should fork? This is stalling several PRs.