public IssueReport GetIssueReport(PackageVerifierIssue packageIssue, IPackageMetadata package)
        {
            if (_allIssuesToIgnore != null)
            {
                // If there are issues to ignore, process them
                var ignoredRule = _allIssuesToIgnore.Find(
                    issueIgnore =>
                    string.Equals(issueIgnore.IssueId, packageIssue.IssueId, StringComparison.OrdinalIgnoreCase) &&
                    string.Equals(issueIgnore.Instance, packageIssue.Instance ?? "*", StringComparison.OrdinalIgnoreCase) &&
                    string.Equals(issueIgnore.PackageId, package.Id, StringComparison.OrdinalIgnoreCase));

                if (ignoredRule != null)
                {
                    RemainingIssuesToIgnore.Remove(ignoredRule);

                    return(new IssueReport(
                               packageIssue,
                               ignore: true,
                               ignoreJustification: ignoredRule.Justification));
                }

                return(new IssueReport(
                           packageIssue,
                           ignore: false,
                           ignoreJustification: null));
            }
            // If nothing to ignore, just report the issue as-is
            return(new IssueReport(packageIssue, false, null));
        }
        public IssueReport GetIssueReport(PackageVerifierIssue packageIssue, IPackage package)
        {
            if (IssuesToIgnore != null)
            {
                // If there are issues to ignore, process them
                var ignoredRules = IssuesToIgnore.Where(
                    issueIgnore =>
                        string.Equals(issueIgnore.IssueId, packageIssue.IssueId, StringComparison.OrdinalIgnoreCase) &&
                        string.Equals(issueIgnore.Instance, packageIssue.Instance ?? "*", StringComparison.OrdinalIgnoreCase) &&
                        string.Equals(issueIgnore.PackageId, package.Id, StringComparison.OrdinalIgnoreCase));

                var firstIgnoreRule = ignoredRules.FirstOrDefault();
                return new IssueReport(packageIssue, firstIgnoreRule != null, firstIgnoreRule == null ? null : firstIgnoreRule.Justification);
            }
            else
            {
                // If nothing to ignore, just report the issue as-is
                return new IssueReport(packageIssue, false, null);
            }
        }
Exemple #3
0
        public IssueReport GetIssueReport(PackageVerifierIssue packageIssue, IPackage package)
        {
            if (IssuesToIgnore != null)
            {
                // If there are issues to ignore, process them
                var ignoredRules = IssuesToIgnore.Where(
                    issueIgnore =>
                    string.Equals(issueIgnore.IssueId, packageIssue.IssueId, StringComparison.OrdinalIgnoreCase) &&
                    string.Equals(issueIgnore.Instance, packageIssue.Instance ?? "*", StringComparison.OrdinalIgnoreCase) &&
                    string.Equals(issueIgnore.PackageId, package.Id, StringComparison.OrdinalIgnoreCase));

                var firstIgnoreRule = ignoredRules.FirstOrDefault();
                return(new IssueReport(packageIssue, firstIgnoreRule != null, firstIgnoreRule == null ? null : firstIgnoreRule.Justification));
            }
            else
            {
                // If nothing to ignore, just report the issue as-is
                return(new IssueReport(packageIssue, false, null));
            }
        }
Exemple #4
0
 public IssueReport(PackageVerifierIssue packageIssue, bool ignore, string ignoreJustification)
 {
     PackageIssue        = packageIssue;
     IssueLevel          = ignore ? LogLevel.Info : packageIssue.Level == MyPackageIssueLevel.Warning ? LogLevel.Warning : LogLevel.Error;
     IgnoreJustification = ignoreJustification;
 }
Exemple #5
0
 public IssueReport(PackageVerifierIssue packageIssue, bool ignore, string ignoreJustification)
 {
     PackageIssue = packageIssue;
     IssueLevel = ignore ? LogLevel.Info : packageIssue.Level == MyPackageIssueLevel.Warning ? LogLevel.Warning : LogLevel.Error;
     IgnoreJustification = ignoreJustification;
 }