Пример #1
0
        protected override ReportedViolation HandleDependencyViolation(
            DependencyViolationType violationType,
            AccessLevel accessLevel,
            AbsolutePath path,
            Process violator,
            bool isWhitelistedViolation,
            Pip related,
            AbsolutePath processPath)
        {
            ReportedViolation reportedViolation = new ReportedViolation(true, violationType, path, violator.PipId, related?.PipId, processPath);

            if (m_doLogging)
            {
                reportedViolation = base.HandleDependencyViolation(violationType, accessLevel, path, violator, isWhitelistedViolation, related, processPath);
            }

            // Always collect error violations, and also collect other non-errors if asked to.
            if (reportedViolation.IsError || m_collectNonErrorViolations)
            {
                bool added = CollectedViolations.Add(
                    new DependencyViolation(
                        violationType,
                        accessLevel,
                        path,
                        violator,
                        related
                        ));

                XAssert.IsTrue(added, "Duplicate violation reported");
            }

            return(reportedViolation);
        }
Пример #2
0
 /// <nodoc/>
 public ReportedViolation(bool isError, DependencyViolationType type, AbsolutePath path, PipId violatorPipId, PipId?relatedPipId, AbsolutePath processPath, bool violationMakesPipUncacheable = true)
 {
     IsError       = isError;
     Type          = type;
     Path          = path;
     ViolatorPipId = violatorPipId;
     RelatedPipId  = relatedPipId;
     ProcessPath   = processPath;
     ViolationMakesPipUncacheable = violationMakesPipUncacheable;
 }
Пример #3
0
            protected override ReportedViolation HandleDependencyViolation(
                DependencyViolationType violationType,
                AccessLevel accessLevel,
                AbsolutePath path,
                Process violator,
                bool isWhitelistedViolation,
                Pip related,
                AbsolutePath processPath)
            {
                m_whitelistAnalyzer.HandleDependencyViolation(violationType, accessLevel, path, violator, related);

                // Dummy return value
                return(new ReportedViolation(false, violationType, path, violator.PipId, related?.PipId, processPath));
            }