Skip to content

Commit

Permalink
Add disabled scoring system (#4944)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaym authored Dec 3, 2024
1 parent a70649a commit 82eb3d6
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 71 deletions.
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

0 comments on commit 82eb3d6

Please sign in to comment.