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

main #48

Merged
merged 3 commits into from
Jun 17, 2021
Merged

main #48

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
4 changes: 4 additions & 0 deletions pkg/enums/languages/language.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
Elixir Language = "Elixir"
Shell Language = "Shell"
Nginx Language = "Nginx"
Swift Language = "Swift"
Unknown Language = "Unknown"
)

Expand Down Expand Up @@ -73,6 +74,7 @@ func Values() []Language {
Elixir,
Shell,
Nginx,
Swift,
Unknown,
}
}
Expand All @@ -99,6 +101,7 @@ func mapEnableLanguages() map[string]Language {
Elixir.ToString(): Elixir,
Shell.ToString(): Shell,
Nginx.ToString(): Nginx,
Swift.ToString(): Swift,
Unknown.ToString(): Unknown,
}
}
Expand Down Expand Up @@ -131,5 +134,6 @@ func (l Language) MapLanguagesEnableInCLI() map[Language]string {
Yaml: "yaml",
Dart: "dart",
Nginx: "nginx",
Swift: "swift",
}
}
8 changes: 6 additions & 2 deletions pkg/enums/languages/language_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ func TestParseStringToLanguage(t *testing.T) {
assert.Equal(t, Elixir, ParseStringToLanguage("Elixir"))
assert.Equal(t, Shell, ParseStringToLanguage("Shell"))
assert.Equal(t, Nginx, ParseStringToLanguage("Nginx"))
assert.Equal(t, Swift, ParseStringToLanguage("Swift"))
assert.Equal(t, Unknown, ParseStringToLanguage(""))
})
}

func TestValues(t *testing.T) {
t.Run("should return 20 valid values", func(t *testing.T) {
assert.Len(t, Values(), 20)
t.Run("should return 21 valid values", func(t *testing.T) {
assert.Len(t, Values(), 21)
})
}

Expand All @@ -74,6 +75,7 @@ func TestMapEnableLanguages(t *testing.T) {
assert.Equal(t, Elixir, mapLanguages["Elixir"])
assert.Equal(t, Shell, mapLanguages["Shell"])
assert.Equal(t, Nginx, mapLanguages["Nginx"])
assert.Equal(t, Swift, mapLanguages["Swift"])
assert.Equal(t, Unknown, mapLanguages["Unknown"])
})
}
Expand All @@ -99,6 +101,7 @@ func TestToString(t *testing.T) {
assert.Equal(t, "Elixir", Elixir.ToString())
assert.Equal(t, "Shell", Shell.ToString())
assert.Equal(t, "Nginx", Nginx.ToString())
assert.Equal(t, "Swift", Swift.ToString())
assert.Equal(t, "Unknown", Unknown.ToString())
})
}
Expand All @@ -121,5 +124,6 @@ func TestGetCustomImagesKeyByLanguage(t *testing.T) {
assert.Equal(t, "elixir", Elixir.GetCustomImagesKeyByLanguage())
assert.Equal(t, "shell", Shell.GetCustomImagesKeyByLanguage())
assert.Equal(t, "nginx", Nginx.GetCustomImagesKeyByLanguage())
assert.Equal(t, "swift", Swift.GetCustomImagesKeyByLanguage())
})
}
36 changes: 19 additions & 17 deletions pkg/enums/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,24 @@ import "github.com/iancoleman/strcase"
type Tool string

const (
HorusecEngine Tool = "HorusecEngine"
GoSec Tool = "GoSec"
SecurityCodeScan Tool = "SecurityCodeScan"
Brakeman Tool = "Brakeman"
Safety Tool = "Safety"
Bandit Tool = "Bandit"
NpmAudit Tool = "NpmAudit"
YarnAudit Tool = "YarnAudit"
GitLeaks Tool = "GitLeaks"
TfSec Tool = "TfSec"
Semgrep Tool = "Semgrep"
Flawfinder Tool = "Flawfinder"
PhpCS Tool = "PhpCS"
MixAudit Tool = "MixAudit"
Sobelow Tool = "Sobelow"
ShellCheck Tool = "ShellCheck"
BundlerAudit Tool = "BundlerAudit"
HorusecEngine Tool = "HorusecEngine"
GoSec Tool = "GoSec"
SecurityCodeScan Tool = "SecurityCodeScan"
Brakeman Tool = "Brakeman"
Safety Tool = "Safety"
Bandit Tool = "Bandit"
NpmAudit Tool = "NpmAudit"
YarnAudit Tool = "YarnAudit"
GitLeaks Tool = "GitLeaks"
TfSec Tool = "TfSec"
Semgrep Tool = "Semgrep"
Flawfinder Tool = "Flawfinder"
PhpCS Tool = "PhpCS"
MixAudit Tool = "MixAudit"
Sobelow Tool = "Sobelow"
ShellCheck Tool = "ShellCheck"
BundlerAudit Tool = "BundlerAudit"
OwaspDependencyCheck Tool = "OwaspDependencyCheck"
)

func (t Tool) ToString() string {
Expand Down Expand Up @@ -66,5 +67,6 @@ func Values() []Tool {
Sobelow,
ShellCheck,
BundlerAudit,
OwaspDependencyCheck,
}
}
6 changes: 4 additions & 2 deletions pkg/enums/tools/tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func TestToString(t *testing.T) {
assert.Equal(t, "Sobelow", Sobelow.ToString())
assert.Equal(t, "ShellCheck", ShellCheck.ToString())
assert.Equal(t, "BundlerAudit", BundlerAudit.ToString())
assert.Equal(t, "OwaspDependencyCheck", OwaspDependencyCheck.ToString())
})
}

Expand All @@ -61,11 +62,12 @@ func TestToLowerCase(t *testing.T) {
assert.Equal(t, "sobelow", Sobelow.ToLowerCamel())
assert.Equal(t, "shellCheck", ShellCheck.ToLowerCamel())
assert.Equal(t, "bundlerAudit", BundlerAudit.ToLowerCamel())
assert.Equal(t, "owaspDependencyCheck", OwaspDependencyCheck.ToLowerCamel())
})
}

func TestValues(t *testing.T) {
t.Run("should return 17 valid values", func(t *testing.T) {
assert.Len(t, Values(), 17)
t.Run("should return 18 valid values", func(t *testing.T) {
assert.Len(t, Values(), 18)
})
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading