mirror of
https://github.com/safedep/vet.git
synced 2025-12-12 22:23:59 -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)
|
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) {
|
func (s *exceptionStore) Match(pkg *models.Package) (*exceptionMatchResult, error) {
|
||||||
result := exceptionMatchResult{}
|
result := exceptionMatchResult{}
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/safedep/dry/utils"
|
"github.com/safedep/dry/utils"
|
||||||
"github.com/safedep/vet/gen/insightapi"
|
"github.com/safedep/vet/gen/insightapi"
|
||||||
"github.com/safedep/vet/pkg/analyzer"
|
"github.com/safedep/vet/pkg/analyzer"
|
||||||
|
"github.com/safedep/vet/pkg/exceptions"
|
||||||
"github.com/safedep/vet/pkg/models"
|
"github.com/safedep/vet/pkg/models"
|
||||||
"github.com/safedep/vet/pkg/policy"
|
"github.com/safedep/vet/pkg/policy"
|
||||||
"github.com/safedep/vet/pkg/readers"
|
"github.com/safedep/vet/pkg/readers"
|
||||||
@ -198,9 +199,14 @@ func (r *summaryReporter) Finish() error {
|
|||||||
r.renderRemediationAdvice()
|
r.renderRemediationAdvice()
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
|
||||||
fmt.Println("Run with `vet --filter=\"...\"` for custom filters to identify risky libraries")
|
if exceptions.ActiveCount() > 0 {
|
||||||
|
fmt.Println(text.Faint.Sprint(summaryListPrependText, r.exceptionsCountStatement()))
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("Run with `vet --filter=\"...\"` for custom filters to identify risky libraries")
|
||||||
fmt.Println("For more details", text.Bold.Sprint("https://github.com/safedep/vet"))
|
fmt.Println("For more details", text.Bold.Sprint("https://github.com/safedep/vet"))
|
||||||
|
fmt.Println()
|
||||||
|
|
||||||
return nil
|
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",
|
return fmt.Sprintf("%d libraries are out of date with major version drift in direct dependencies",
|
||||||
r.summary.metrics.drifts)
|
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