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

Add disabled scoring system #4944

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
146 changes: 75 additions & 71 deletions explorer/cnquery_explorer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions explorer/cnquery_explorer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ enum ScoringSystem {
// score value. This means that a few critical findings will quickly reduce
// the resulting score, but it won't just drop it to the lowest value.
DECAYED = 7;
DISABLED = 8;
}

// Impact explains how important certain queries are. They are especially useful
Expand Down
8 changes: 8 additions & 0 deletions explorer/impact.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ func (s *ScoringSystem) UnmarshalJSON(data []byte) error {
*s = ScoringSystem_BANDED
case "decayed":
*s = ScoringSystem_DECAYED
case "disabled":
*s = ScoringSystem_DISABLED
default:
return errors.New("unknown scoring system: " + string(data))
}
Expand Down Expand Up @@ -169,6 +171,8 @@ func (s *ScoringSystem) UnmarshalYAML(node *yaml.Node) error {
*s = ScoringSystem_BANDED
case "decayed":
*s = ScoringSystem_DECAYED
case "disabled":
*s = ScoringSystem_DISABLED
default:
return errors.New("unknown scoring system: " + string(name))
}
Expand All @@ -195,6 +199,8 @@ func (s ScoringSystem) MarshalJSON() ([]byte, error) {
result = "banded"
case ScoringSystem_DECAYED:
result = "decayed"
case ScoringSystem_DISABLED:
result = "disabled"
default:
result = "unknown"
}
Expand All @@ -220,6 +226,8 @@ func (s ScoringSystem) MarshalYAML() (interface{}, error) {
return "banded", nil
case ScoringSystem_DECAYED:
return "decayed", nil
case ScoringSystem_DISABLED:
return "disabled", nil
default:
return s, nil
}
Expand Down
Loading