Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNORE level results only show in debug mode #148

Merged
merged 2 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
IGNORE level results only show in debug mode
  • Loading branch information
tomoyamachi committed Sep 10, 2021
commit e49a61116dffd3e472ebaacd73a738904843f57b
2 changes: 1 addition & 1 deletion pkg/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func Run(c *cli.Context) (err error) {

log.Logger.Debug("End assessments...")

assessmentMap := types.CreateAssessmentMap(assessments, config.Conf.IgnoreMap)
assessmentMap := types.CreateAssessmentMap(assessments, config.Conf.IgnoreMap, debug)
// Store ignore checkpoint code
o := c.String("output")
output := os.Stdout
Expand Down
6 changes: 5 additions & 1 deletion pkg/types/assessment.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ type CodeInfo struct {
}
type AssessmentMap map[string]CodeInfo

func CreateAssessmentMap(as AssessmentSlice, ignoreMap map[string]struct{}) AssessmentMap {
func CreateAssessmentMap(as AssessmentSlice, ignoreMap map[string]struct{}, debug bool) AssessmentMap {
asMap := AssessmentMap{}
for _, a := range as {
level := a.Level
if level == 0 {
level = DefaultLevelMap[a.Code]
}
if _, ok := ignoreMap[a.Code]; ok {
// ignore level only shows DEBUG mode
if !debug {
continue
}
level = IgnoreLevel
}
if _, ok := asMap[a.Code]; !ok {
Expand Down