From cced038257d3eec5b7c48bc524de5165b5734496 Mon Sep 17 00:00:00 2001 From: Alexey Palazhchenko Date: Mon, 6 Sep 2021 15:21:55 +0000 Subject: [PATCH] chore: fix license headers Add `make conformance` target. Signed-off-by: Alexey Palazhchenko --- .conform.yaml | 40 +++++++++++++++++++ Makefile | 3 ++ api/v1alpha2/doc.go | 3 -- api/v1alpha2/groupversion_info.go | 20 +++------- api/v1alpha2/talosconfig_conversion.go | 4 ++ api/v1alpha2/talosconfig_types.go | 18 ++------- api/v1alpha2/talosconfigtemplate_types.go | 17 ++------ api/v1alpha2/types.go | 6 +++ api/v1alpha2/zz_generated.conversion.go | 18 ++------- api/v1alpha2/zz_generated.deepcopy.go | 17 ++------ api/v1alpha3/doc.go | 1 - api/v1alpha3/groupversion_info.go | 20 +++------- api/v1alpha3/talosconfig_types.go | 17 ++------ api/v1alpha3/talosconfig_webhook.go | 4 ++ api/v1alpha3/talosconfiglist_webhook.go | 4 ++ api/v1alpha3/talosconfigtemplate_types.go | 17 ++------ api/v1alpha3/talosconfigtemplate_webhook.go | 4 ++ .../talosconfigtemplatelist_webhook.go | 4 ++ api/v1alpha3/types.go | 4 ++ api/v1alpha3/zz_generated.deepcopy.go | 17 ++------ controllers/scheme.go | 17 ++------ controllers/secrets.go | 17 ++------ controllers/talosconfig_controller.go | 17 ++------ hack/boilerplate.go.txt | 17 ++------ internal/integration/integration_test.go | 17 ++------ internal/integration/setup_test.go | 17 ++------ main.go | 17 ++------ 27 files changed, 126 insertions(+), 231 deletions(-) create mode 100644 .conform.yaml delete mode 100644 api/v1alpha2/doc.go delete mode 100644 api/v1alpha3/doc.go diff --git a/.conform.yaml b/.conform.yaml new file mode 100644 index 0000000..01e4634 --- /dev/null +++ b/.conform.yaml @@ -0,0 +1,40 @@ +policies: + - type: commit + spec: + dco: true + gpg: + required: true + identity: + gitHubOrganization: talos-systems + spellcheck: + locale: US + maximumOfOneCommit: true + header: + length: 89 + imperative: true + case: lower + invalidLastCharacters: . + body: + required: true + conventional: + types: + - chore + - docs + - perf + - refactor + - style + - test + - release + scopes: [] + - type: license + spec: + skipPaths: + - .git/ + includeSuffixes: + - .go + excludeSuffixes: [] + allowPrecedingComments: true + header: | + // This Source Code Form is subject to the terms of the Mozilla Public + // License, v. 2.0. If a copy of the MPL was not distributed with this + // file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/Makefile b/Makefile index c425743..c8d2f32 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,9 @@ run: install ## Run the controller locally. This is for testing purposes only. clean: @rm -rf $(ARTIFACTS) +conformance: ## Performs policy checks against the commit and source code. + docker run --rm -it -v $(PWD):/src -w /src ghcr.io/talos-systems/conform:v0.1.0-alpha.23 enforce + # Make `make test` behave just like `go test` regarding relative paths. test: ## Run tests. @$(MAKE) local-integration-test DEST=./internal/integration PLATFORM=linux/amd64 diff --git a/api/v1alpha2/doc.go b/api/v1alpha2/doc.go deleted file mode 100644 index 0ea65db..0000000 --- a/api/v1alpha2/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -package v1alpha2 - -// +k8s:conversion-gen=github.com/talos-systems/cluster-api-bootstrap-provider-talos/api/v1alpha3 diff --git a/api/v1alpha2/groupversion_info.go b/api/v1alpha2/groupversion_info.go index 48e2bb9..25d479a 100644 --- a/api/v1alpha2/groupversion_info.go +++ b/api/v1alpha2/groupversion_info.go @@ -1,19 +1,9 @@ -/* +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha2 contains API Schema definitions for the bootstrap v1alpha2 API group +// Package v1alpha2 contains API Schema definitions for the bootstrap v1alpha2 API group. +// // +kubebuilder:object:generate=true // +groupName=bootstrap.cluster.x-k8s.io package v1alpha2 diff --git a/api/v1alpha2/talosconfig_conversion.go b/api/v1alpha2/talosconfig_conversion.go index 88f1398..66dea58 100644 --- a/api/v1alpha2/talosconfig_conversion.go +++ b/api/v1alpha2/talosconfig_conversion.go @@ -1,3 +1,7 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package v1alpha2 import ( diff --git a/api/v1alpha2/talosconfig_types.go b/api/v1alpha2/talosconfig_types.go index da672b9..4cfa090 100644 --- a/api/v1alpha2/talosconfig_types.go +++ b/api/v1alpha2/talosconfig_types.go @@ -1,17 +1,6 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. package v1alpha2 @@ -24,7 +13,6 @@ const ( ConfigFinalizer = "talosconfig.bootstrap.cluster.x-k8s.io" ) -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. // TalosConfigSpec defines the desired state of TalosConfig diff --git a/api/v1alpha2/talosconfigtemplate_types.go b/api/v1alpha2/talosconfigtemplate_types.go index b6909e0..59c751f 100644 --- a/api/v1alpha2/talosconfigtemplate_types.go +++ b/api/v1alpha2/talosconfigtemplate_types.go @@ -1,17 +1,6 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. package v1alpha2 diff --git a/api/v1alpha2/types.go b/api/v1alpha2/types.go index 3fadbd8..b6b8af1 100644 --- a/api/v1alpha2/types.go +++ b/api/v1alpha2/types.go @@ -1,5 +1,11 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package v1alpha2 +// +k8s:conversion-gen=github.com/talos-systems/cluster-api-bootstrap-provider-talos/api/v1alpha3 + // TalosConfigTemplateResource defines the Template structure type TalosConfigTemplateResource struct { Spec TalosConfigSpec `json:"spec,omitempty"` diff --git a/api/v1alpha2/zz_generated.conversion.go b/api/v1alpha2/zz_generated.conversion.go index 1bb0240..d2c9eca 100644 --- a/api/v1alpha2/zz_generated.conversion.go +++ b/api/v1alpha2/zz_generated.conversion.go @@ -1,20 +1,10 @@ // +build !ignore_autogenerated -/* +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by conversion-gen. DO NOT EDIT. +// Code generated by controller-gen. DO NOT EDIT. package v1alpha2 diff --git a/api/v1alpha2/zz_generated.deepcopy.go b/api/v1alpha2/zz_generated.deepcopy.go index e5d3eae..7fa3d9b 100644 --- a/api/v1alpha2/zz_generated.deepcopy.go +++ b/api/v1alpha2/zz_generated.deepcopy.go @@ -1,19 +1,8 @@ // +build !ignore_autogenerated -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. // Code generated by controller-gen. DO NOT EDIT. diff --git a/api/v1alpha3/doc.go b/api/v1alpha3/doc.go deleted file mode 100644 index 08f84e9..0000000 --- a/api/v1alpha3/doc.go +++ /dev/null @@ -1 +0,0 @@ -package v1alpha3 diff --git a/api/v1alpha3/groupversion_info.go b/api/v1alpha3/groupversion_info.go index eaf3162..f1c4104 100644 --- a/api/v1alpha3/groupversion_info.go +++ b/api/v1alpha3/groupversion_info.go @@ -1,19 +1,9 @@ -/* +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha3 contains API Schema definitions for the bootstrap v1alpha3 API group +// Package v1alpha3 contains API Schema definitions for the bootstrap v1alpha3 API group. +// // +kubebuilder:object:generate=true // +groupName=bootstrap.cluster.x-k8s.io package v1alpha3 diff --git a/api/v1alpha3/talosconfig_types.go b/api/v1alpha3/talosconfig_types.go index e03973d..b68e7f5 100644 --- a/api/v1alpha3/talosconfig_types.go +++ b/api/v1alpha3/talosconfig_types.go @@ -1,17 +1,6 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. package v1alpha3 diff --git a/api/v1alpha3/talosconfig_webhook.go b/api/v1alpha3/talosconfig_webhook.go index 83e7c6c..0a9f90b 100644 --- a/api/v1alpha3/talosconfig_webhook.go +++ b/api/v1alpha3/talosconfig_webhook.go @@ -1,3 +1,7 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package v1alpha3 import ( diff --git a/api/v1alpha3/talosconfiglist_webhook.go b/api/v1alpha3/talosconfiglist_webhook.go index 6f8827b..183ed47 100644 --- a/api/v1alpha3/talosconfiglist_webhook.go +++ b/api/v1alpha3/talosconfiglist_webhook.go @@ -1,3 +1,7 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package v1alpha3 import ( diff --git a/api/v1alpha3/talosconfigtemplate_types.go b/api/v1alpha3/talosconfigtemplate_types.go index 80f2dbe..52593eb 100644 --- a/api/v1alpha3/talosconfigtemplate_types.go +++ b/api/v1alpha3/talosconfigtemplate_types.go @@ -1,17 +1,6 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. package v1alpha3 diff --git a/api/v1alpha3/talosconfigtemplate_webhook.go b/api/v1alpha3/talosconfigtemplate_webhook.go index 4bb3bb0..dae4617 100644 --- a/api/v1alpha3/talosconfigtemplate_webhook.go +++ b/api/v1alpha3/talosconfigtemplate_webhook.go @@ -1,3 +1,7 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package v1alpha3 import ( diff --git a/api/v1alpha3/talosconfigtemplatelist_webhook.go b/api/v1alpha3/talosconfigtemplatelist_webhook.go index 81270ef..e4aeb8e 100644 --- a/api/v1alpha3/talosconfigtemplatelist_webhook.go +++ b/api/v1alpha3/talosconfigtemplatelist_webhook.go @@ -1,3 +1,7 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package v1alpha3 import ( diff --git a/api/v1alpha3/types.go b/api/v1alpha3/types.go index 38d3199..9e6d944 100644 --- a/api/v1alpha3/types.go +++ b/api/v1alpha3/types.go @@ -1,3 +1,7 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + package v1alpha3 import apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" diff --git a/api/v1alpha3/zz_generated.deepcopy.go b/api/v1alpha3/zz_generated.deepcopy.go index 6eef89b..d6f78f2 100644 --- a/api/v1alpha3/zz_generated.deepcopy.go +++ b/api/v1alpha3/zz_generated.deepcopy.go @@ -1,19 +1,8 @@ // +build !ignore_autogenerated -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. // Code generated by controller-gen. DO NOT EDIT. diff --git a/controllers/scheme.go b/controllers/scheme.go index 64792e8..0833401 100644 --- a/controllers/scheme.go +++ b/controllers/scheme.go @@ -1,17 +1,6 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. package controllers diff --git a/controllers/secrets.go b/controllers/secrets.go index d89cc72..b1ae819 100644 --- a/controllers/secrets.go +++ b/controllers/secrets.go @@ -1,17 +1,6 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. package controllers diff --git a/controllers/talosconfig_controller.go b/controllers/talosconfig_controller.go index 4b92f5d..f7abcd9 100644 --- a/controllers/talosconfig_controller.go +++ b/controllers/talosconfig_controller.go @@ -1,17 +1,6 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. package controllers diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index b92001f..66e0819 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,14 +1,3 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ \ No newline at end of file +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/internal/integration/integration_test.go b/internal/integration/integration_test.go index 3d77b0d..322b2a1 100644 --- a/internal/integration/integration_test.go +++ b/internal/integration/integration_test.go @@ -1,17 +1,6 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. package integration diff --git a/internal/integration/setup_test.go b/internal/integration/setup_test.go index b5fd38d..b69d297 100644 --- a/internal/integration/setup_test.go +++ b/internal/integration/setup_test.go @@ -1,17 +1,6 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. package integration diff --git a/main.go b/main.go index c35e860..52257a7 100644 --- a/main.go +++ b/main.go @@ -1,17 +1,6 @@ -/* - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. package main