Ejemplo n.º 1
0
        static void Process(string path, SearchOptions options, SearchRange range, ActionType action, IEnumerable <ParsedCommit> commitsToIgnore)
        {
            IEnumerable <CommitInfo> commits = CommitFinder.Parse(path, range);

            Explain.Print($"Found {commits.Count ()} commits.");

            switch (action)
            {
            case ActionType.ListConsideredCommits:
                PrintCommits(commits);
                return;

            case ActionType.ListBugs:
                var parsedCommits = CommitParser.Parse(commits, options).ToList();
                var bugCollection = BugCollector.ClassifyCommits(parsedCommits, options, commitsToIgnore);
                PrintBugs(bugCollection, options);

                if (options.ValidateBugStatus)
                {
                    BugValidator.Validate(bugCollection, options);
                }

                return;

            default:
                throw new InvalidOperationException($"Internal Error - Unknown action requested {action}");
            }
        }
Ejemplo n.º 2
0
        IEnumerable <ParsedCommit> ProcessOldestBranch()
        {
            if (Range.OldestBranch.HasValue)
            {
                var branchName = Range.OldestBranch.ValueOrFailure();
                if (branchName.StartsWith("origin/", StringComparison.InvariantCulture))
                {
                    branchName = branchName.Remove(0, 7);
                }

                var commitInfo = CommitFinder.FindCommitsOnBranchToIgnore(Path, branchName, Options);

                IEnumerable <ParsedCommit> commitsToIgnore = CommitParser.Parse(commitInfo.Item1, Options);

                Explain.Print($"Found {commitsToIgnore.Count ()} bugs on {branchName} after branch to ignore.");

                Range.Oldest        = commitInfo.Item2.Some();
                Range.IncludeOldest = false;
                return(commitsToIgnore);
            }
            return(Enumerable.Empty <ParsedCommit> ());
        }