@@ -135,16 +135,16 @@ endif
135135 prepareStaticRecipe = append (prepareStaticRecipe , "install-shellcheck" )
136136 }
137137
138- if isSAPCC {
139- if isGolang {
140- prepare . addRule ( rule {
141- description : "Install-go-licence-detector required by check-dependency-licenses/static-check" ,
142- phony : true ,
143- target : "install-go -licence-detector" ,
144- recipe : installTool ( "go-licence-detector" , "go.elastic.co/go-licence-detector@latest" ),
145- } )
146- prepareStaticRecipe = append ( prepareStaticRecipe , "install-go-licence-detector" )
147- }
138+ if isGolang && ( cfg . License . AddHeaders . UnwrapOr ( isSAPCC ) || cfg . License . CheckDependencies . UnwrapOr ( isSAPCC )) {
139+ prepare . addRule ( rule {
140+ description : "Install-go-licence-detector required by check-dependency-licenses/static-check" ,
141+ phony : true ,
142+ target : "install-go-licence-detector" ,
143+ recipe : installTool ( "go-licence-detector" , "go.elastic.co/go -licence-detector@latest" ) ,
144+ })
145+ prepareStaticRecipe = append ( prepareStaticRecipe , "install-go-licence-detector" )
146+ }
147+ if cfg . License . AddHeaders . UnwrapOr ( isSAPCC ) {
148148 prepare .addRule (rule {
149149 description : "Install addlicense required by check-license-headers/license-headers/static-check" ,
150150 phony : true ,
@@ -490,7 +490,7 @@ endif
490490 allSourceFilesExpr = `$(shell find -name *.rs)`
491491 }
492492
493- if isSAPCC {
493+ if cfg . License . AddHeaders . UnwrapOr ( isSAPCC ) {
494494 var ignoreOptions []string
495495 if cfg .GitHubWorkflow != nil {
496496 for _ , pattern := range cfg .GitHubWorkflow .License .IgnorePatterns {
@@ -592,11 +592,16 @@ endif
592592 }
593593 }
594594
595+ staticCheckPrerequisites := []string {"run-shellcheck" }
596+
595597 if isGolang {
596598 // add target for static code checks
597- staticCheckPrerequisites := []string {"run-shellcheck" , "run-golangci-lint" , "run-modernize" }
598- if isSAPCC {
599- staticCheckPrerequisites = append (staticCheckPrerequisites , "check-dependency-licenses" , "check-license-headers" )
599+ staticCheckPrerequisites = append (staticCheckPrerequisites , "run-golangci-lint" , "run-modernize" )
600+ if cfg .License .CheckDependencies .UnwrapOr (isSAPCC ) {
601+ staticCheckPrerequisites = append (staticCheckPrerequisites , "check-dependency-licenses" )
602+ }
603+ if cfg .License .AddHeaders .UnwrapOr (isSAPCC ) {
604+ staticCheckPrerequisites = append (staticCheckPrerequisites , "check-license-headers" )
600605 }
601606 test .addRule (rule {
602607 description : "Run static code checks (internal option to enforce --keep-going)" ,
0 commit comments