Skip to content

Add --verbosity diagnostic flag option for debugging "Error: No files found matching glob pattern." #372

@jzabroski

Description

@jzabroski

Like others #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.

Console.WriteLine("Error: No files found matching glob pattern.");

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
                                         }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions