Skip to content

Commit

Permalink
Merge pull request #195 from sapcc/fix-addlicense-options-spacing
Browse files Browse the repository at this point in the history
makefile: fix spacing of addlicense options
  • Loading branch information
Nuckal777 authored Sep 5, 2024
2 parents fda25eb + da85563 commit 766c28a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions internal/makefile/makefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,14 @@ endif
allSourceFilesExpr = `$(shell find -name *.rs)`
}

ignoreOptions := []string{}
var ignoreOptions []string
if cfg.GitHubWorkflow != nil {
for _, pattern := range cfg.GitHubWorkflow.License.IgnorePatterns {
// quoting avoids glob expansion
ignoreOptions = append(ignoreOptions, fmt.Sprintf("-ignore %q", pattern))
}
}
ignoreOptionsStr := strings.Join(append(ignoreOptions, "--"), " ")

dev.addRule(rule{
description: "Add license headers to all non-vendored source code files.",
Expand All @@ -390,10 +391,7 @@ endif
prerequisites: []string{"prepare-static-check"},
recipe: []string{
`@printf "\e[1;36m>> addlicense\e[0m\n"`,
fmt.Sprintf(`@addlicense -c "SAP SE" %s-- %s`,
strings.Join(ignoreOptions, " "),
allSourceFilesExpr,
)},
fmt.Sprintf(`@addlicense -c "SAP SE" %s %s`, ignoreOptionsStr, allSourceFilesExpr)},
})

dev.addRule(rule{
Expand All @@ -403,10 +401,7 @@ endif
prerequisites: []string{"prepare-static-check"},
recipe: []string{
`@printf "\e[1;36m>> addlicense --check\e[0m\n"`,
fmt.Sprintf(`@addlicense --check %s-- %s`,
strings.Join(ignoreOptions, " "),
allSourceFilesExpr,
)},
fmt.Sprintf(`@addlicense --check %s %s`, ignoreOptionsStr, allSourceFilesExpr)},
})

if isGolang {
Expand Down

0 comments on commit 766c28a

Please sign in to comment.