diff --git a/pkg/enums/languages/language.go b/pkg/enums/languages/language.go index bb7b692..96cbf97 100644 --- a/pkg/enums/languages/language.go +++ b/pkg/enums/languages/language.go @@ -38,6 +38,7 @@ const ( Elixir Language = "Elixir" Shell Language = "Shell" Nginx Language = "Nginx" + Swift Language = "Swift" Unknown Language = "Unknown" ) @@ -73,6 +74,7 @@ func Values() []Language { Elixir, Shell, Nginx, + Swift, Unknown, } } @@ -99,6 +101,7 @@ func mapEnableLanguages() map[string]Language { Elixir.ToString(): Elixir, Shell.ToString(): Shell, Nginx.ToString(): Nginx, + Swift.ToString(): Swift, Unknown.ToString(): Unknown, } } @@ -131,5 +134,6 @@ func (l Language) MapLanguagesEnableInCLI() map[Language]string { Yaml: "yaml", Dart: "dart", Nginx: "nginx", + Swift: "swift", } } diff --git a/pkg/enums/languages/language_test.go b/pkg/enums/languages/language_test.go index 8f3c49a..4cec8dc 100644 --- a/pkg/enums/languages/language_test.go +++ b/pkg/enums/languages/language_test.go @@ -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) }) } @@ -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"]) }) } @@ -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()) }) } @@ -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()) }) } diff --git a/pkg/enums/tools/tools.go b/pkg/enums/tools/tools.go index bb5a566..3ae7a4f 100644 --- a/pkg/enums/tools/tools.go +++ b/pkg/enums/tools/tools.go @@ -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 { @@ -66,5 +67,6 @@ func Values() []Tool { Sobelow, ShellCheck, BundlerAudit, + OwaspDependencyCheck, } } diff --git a/pkg/enums/tools/tools_test.go b/pkg/enums/tools/tools_test.go index f62635e..01b421c 100644 --- a/pkg/enums/tools/tools_test.go +++ b/pkg/enums/tools/tools_test.go @@ -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()) }) } @@ -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) }) }