Skip to content

Commit 3f2db8a

Browse files
authored
build: Add license headers to generated files (#100)
Silly one to keep license headers up to date in generated files.
2 parents fd760b0 + 7a09b08 commit 3f2db8a

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ repos:
8585
files: "(.*\\.go|go.mod)$"
8686
args:
8787
- --license-filepath
88-
- header.txt
88+
- hack/license-header.txt
8989
- --comment-style
9090
- //
9191
- --use-current-year
@@ -95,17 +95,16 @@ repos:
9595
files: (^Makefile|\.(ya?ml|mk))$
9696
args:
9797
- --license-filepath
98-
- header.txt
98+
- hack/license-header.txt
9999
- --use-current-year
100-
exclude: ^(pkg/addons/templates/.+\.yaml|charts/.+/templates/role\.yaml||charts/.+/crds/.+\.yaml)$
101100
- id: insert-license
102101
name: License headers - Markdown
103102
stages: [commit]
104103
files: \.md$
105104
exclude: ^CHANGELOG.md$
106105
args:
107106
- --license-filepath
108-
- header.txt
107+
- hack/license-header.txt
109108
- --comment-style
110109
- <!--|| -->
111110
- --use-current-year

charts/capi-runtime-extensions/templates/role.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright 2023 D2iQ, Inc. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
13
---
24
apiVersion: rbac.authorization.k8s.io/v1
35
kind: ClusterRole
File renamed without changes.
File renamed without changes.

hack/license-header.yaml.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Copyright 2023 D2iQ, Inc. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0

make/go.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ go-fix.%: ; $(info $(M) go fixing $* module)
177177
go-generate: ## Runs go generate
178178
go-generate: ; $(info $(M) running go generate)
179179
go generate -x ./...
180-
controller-gen rbac:roleName=capi-runtime-extensions-manager-role crd webhook paths="./..." \
181-
output:crd:artifacts:config=charts/capi-runtime-extensions/crds \
182-
output:rbac:artifacts:config=charts/capi-runtime-extensions/templates
183-
controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
180+
controller-gen \
181+
rbac:headerFile="hack/license-header.yaml.txt",roleName=capi-runtime-extensions-manager-role \
182+
object:headerFile="hack/license-header.go.txt" \
183+
output:rbac:artifacts:config=charts/capi-runtime-extensions/templates \
184+
paths="./..."
184185
$(MAKE) go-fix
185186

186187
.PHONY: go-mod-upgrade

0 commit comments

Comments
 (0)