Skip to content

build: Add license headers to generated files #100

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

Merged
merged 1 commit into from
Aug 8, 2023
Merged
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
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ repos:
files: "(.*\\.go|go.mod)$"
args:
- --license-filepath
- header.txt
- hack/license-header.txt
- --comment-style
- //
- --use-current-year
Expand All @@ -95,17 +95,16 @@ repos:
files: (^Makefile|\.(ya?ml|mk))$
args:
- --license-filepath
- header.txt
- hack/license-header.txt
- --use-current-year
exclude: ^(pkg/addons/templates/.+\.yaml|charts/.+/templates/role\.yaml||charts/.+/crds/.+\.yaml)$
- id: insert-license
name: License headers - Markdown
stages: [commit]
files: \.md$
exclude: ^CHANGELOG.md$
args:
- --license-filepath
- header.txt
- hack/license-header.txt
- --comment-style
- <!--|| -->
- --use-current-year
Expand Down
2 changes: 2 additions & 0 deletions charts/capi-runtime-extensions/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright 2023 D2iQ, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions hack/license-header.yaml.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright 2023 D2iQ, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
9 changes: 5 additions & 4 deletions make/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,11 @@ go-fix.%: ; $(info $(M) go fixing $* module)
go-generate: ## Runs go generate
go-generate: ; $(info $(M) running go generate)
go generate -x ./...
controller-gen rbac:roleName=capi-runtime-extensions-manager-role crd webhook paths="./..." \
output:crd:artifacts:config=charts/capi-runtime-extensions/crds \
output:rbac:artifacts:config=charts/capi-runtime-extensions/templates
controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
controller-gen \
rbac:headerFile="hack/license-header.yaml.txt",roleName=capi-runtime-extensions-manager-role \
object:headerFile="hack/license-header.go.txt" \
output:rbac:artifacts:config=charts/capi-runtime-extensions/templates \
paths="./..."
$(MAKE) go-fix

.PHONY: go-mod-upgrade
Expand Down