Skip to content

Commit

Permalink
feat: Shift more severity & ecosystem functionality into place
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkatronic committed Aug 30, 2023
1 parent a0ba10a commit e57e2b2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
10 changes: 0 additions & 10 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ import (
"github.com/spf13/viper"
)

type SeverityConfig struct {
Label string
Slack_emoji string
}

type EcosystemConfig struct {
Label string
Slack_emoji string
}

type TeamConfig struct {
Name string
Github_slug string
Expand Down
15 changes: 15 additions & 0 deletions config/ecosystems.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,18 @@ const (
FindingEcosystemRust FindingEcosystemType = "rust"
FindingEcosystemSwift FindingEcosystemType = "swift"
)

func GetConsoleEcosystemIcons() map[FindingEcosystemType]string {
return map[FindingEcosystemType]string{
FindingEcosystemGo: "🦦",
FindingEcosystemJava: "🪶 ",
FindingEcosystemJS: "⬢ ",
FindingEcosystemPython: "🐍",
FindingEcosystemRuby: "♦️ ",
}

Check warning on line 29 in config/ecosystems.go

View check run for this annotation

Codecov / codecov/patch

config/ecosystems.go#L22-L29

Added lines #L22 - L29 were not covered by tests
}

type EcosystemConfig struct {
Label string
Slack_emoji string
}
16 changes: 16 additions & 0 deletions config/severities.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,19 @@ func GetSeverityReportOrder() []FindingSeverityType {
FindingSeverityUndefined,
}
}

func GetConsoleSeverityColors() map[FindingSeverityType]string {
return map[FindingSeverityType]string{
FindingSeverityCritical: "#B21515",
FindingSeverityHigh: "#D26C00",
FindingSeverityModerate: "#FBD100",
FindingSeverityLow: "#233EB5",
FindingSeverityInfo: "#56B8F5",
FindingSeverityUndefined: "#CFD0D1",
}

Check warning on line 57 in config/severities.go

View check run for this annotation

Codecov / codecov/patch

config/severities.go#L49-L57

Added lines #L49 - L57 were not covered by tests
}

type SeverityConfig struct {
Label string
Slack_emoji string
}

0 comments on commit e57e2b2

Please sign in to comment.