mirror of
https://github.com/safedep/vet.git
synced 2025-12-10 00:22:08 -06:00
Print excepions statement in summary report
This commit is contained in:
parent
4b16c05ff9
commit
2ecc52ef00
@ -94,6 +94,14 @@ func Apply(pkg *models.Package) (*exceptionMatchResult, error) {
|
||||
return globalExceptions.Match(pkg)
|
||||
}
|
||||
|
||||
func ActiveCount() int {
|
||||
return globalExceptions.ActiveCount()
|
||||
}
|
||||
|
||||
func (s *exceptionStore) ActiveCount() int {
|
||||
return len(s.rules)
|
||||
}
|
||||
|
||||
func (s *exceptionStore) Match(pkg *models.Package) (*exceptionMatchResult, error) {
|
||||
result := exceptionMatchResult{}
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import (
|
||||
"github.com/safedep/dry/utils"
|
||||
"github.com/safedep/vet/gen/insightapi"
|
||||
"github.com/safedep/vet/pkg/analyzer"
|
||||
"github.com/safedep/vet/pkg/exceptions"
|
||||
"github.com/safedep/vet/pkg/models"
|
||||
"github.com/safedep/vet/pkg/policy"
|
||||
"github.com/safedep/vet/pkg/readers"
|
||||
@ -198,9 +199,14 @@ func (r *summaryReporter) Finish() error {
|
||||
r.renderRemediationAdvice()
|
||||
fmt.Println()
|
||||
|
||||
if exceptions.ActiveCount() > 0 {
|
||||
fmt.Println(text.Faint.Sprint(summaryListPrependText, r.exceptionsCountStatement()))
|
||||
fmt.Println()
|
||||
}
|
||||
|
||||
fmt.Println("Run with `vet --filter=\"...\"` for custom filters to identify risky libraries")
|
||||
fmt.Println()
|
||||
fmt.Println("For more details", text.Bold.Sprint("https://github.com/safedep/vet"))
|
||||
fmt.Println()
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -298,3 +304,8 @@ func (r *summaryReporter) majorVersionDriftStatement() string {
|
||||
return fmt.Sprintf("%d libraries are out of date with major version drift in direct dependencies",
|
||||
r.summary.metrics.drifts)
|
||||
}
|
||||
|
||||
func (r *summaryReporter) exceptionsCountStatement() string {
|
||||
return fmt.Sprintf("%d libraries are exempted from analysis through exception rules",
|
||||
exceptions.ActiveCount())
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user