From 75f232658ec1443846c4bf3dadb079eeda0bc6db Mon Sep 17 00:00:00 2001 From: "jesus m. rodriguez" Date: Fri, 30 Apr 2021 10:46:07 -0400 Subject: [PATCH] Add licence header to all files; check license script --- Makefile | 1 + hack/check-license.sh | 18 ++++++++++++++++++ pkg/quarkus/v1alpha/api.go | 14 ++++++++++++++ pkg/quarkus/v1alpha/init.go | 14 ++++++++++++++ pkg/quarkus/v1alpha/plugin.go | 14 ++++++++++++++ pkg/quarkus/v1alpha/scaffolds/api.go | 14 ++++++++++++++ pkg/quarkus/v1alpha/scaffolds/doc.go | 14 ++++++++++++++ pkg/quarkus/v1alpha/scaffolds/init.go | 14 ++++++++++++++ .../templates/applicationproperties.go | 14 ++++++++++++++ .../templates/controller/controller.go | 14 ++++++++++++++ .../scaffolds/internal/templates/doc.go | 14 ++++++++++++++ .../scaffolds/internal/templates/gitignore.go | 14 ++++++++++++++ .../internal/templates/model/model.go | 14 ++++++++++++++ .../internal/templates/model/modelspec.go | 14 ++++++++++++++ .../internal/templates/model/modelstatus.go | 14 ++++++++++++++ .../internal/templates/operatorfile.go | 14 ++++++++++++++ .../scaffolds/internal/templates/pomxml.go | 14 ++++++++++++++ .../scaffolds/internal/templates/util/file.go | 14 ++++++++++++++ pkg/quarkus/v1alpha/util/util.go | 14 ++++++++++++++ pkg/quarkus/v1alpha/util/util_suite_test.go | 14 ++++++++++++++ pkg/quarkus/v1alpha/util/util_test.go | 14 ++++++++++++++ 21 files changed, 285 insertions(+) create mode 100755 hack/check-license.sh diff --git a/Makefile b/Makefile index 7f0f9a4..06223d4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ lint: + @./hack/check-license.sh @go fmt ./... test: diff --git a/hack/check-license.sh b/hack/check-license.sh new file mode 100755 index 0000000..00bf3eb --- /dev/null +++ b/hack/check-license.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail + +echo "Checking for license header..." +allfiles=$(find pkg -name '*.go') +licRes="" +for file in $allfiles; do + if ! head -n3 "${file}" | grep -Eq "(Copyright|generated|GENERATED|Licensed)" ; then + licRes="${licRes}\n"$(echo -e " ${file}") + fi +done +if [ -n "${licRes}" ]; then + echo -e "license header checking failed:\n${licRes}" + exit 255 +fi diff --git a/pkg/quarkus/v1alpha/api.go b/pkg/quarkus/v1alpha/api.go index 9d0cf84..fd8e450 100644 --- a/pkg/quarkus/v1alpha/api.go +++ b/pkg/quarkus/v1alpha/api.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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. + /* * Copyright 2021 The Java Operator SDK Authors. * diff --git a/pkg/quarkus/v1alpha/init.go b/pkg/quarkus/v1alpha/init.go index 494a461..c6927ec 100644 --- a/pkg/quarkus/v1alpha/init.go +++ b/pkg/quarkus/v1alpha/init.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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. + /* * Copyright 2021 The Java Operator SDK Authors. * diff --git a/pkg/quarkus/v1alpha/plugin.go b/pkg/quarkus/v1alpha/plugin.go index 7702e5c..56fff32 100644 --- a/pkg/quarkus/v1alpha/plugin.go +++ b/pkg/quarkus/v1alpha/plugin.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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. + /* * Copyright 2021 The Java Operator SDK Authors. * diff --git a/pkg/quarkus/v1alpha/scaffolds/api.go b/pkg/quarkus/v1alpha/scaffolds/api.go index 147e472..37ac659 100644 --- a/pkg/quarkus/v1alpha/scaffolds/api.go +++ b/pkg/quarkus/v1alpha/scaffolds/api.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 scaffolds import ( diff --git a/pkg/quarkus/v1alpha/scaffolds/doc.go b/pkg/quarkus/v1alpha/scaffolds/doc.go index 3954ece..fa8016f 100644 --- a/pkg/quarkus/v1alpha/scaffolds/doc.go +++ b/pkg/quarkus/v1alpha/scaffolds/doc.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 scaffolds will likely contain the files used to scaffold the files for specific commands. */ diff --git a/pkg/quarkus/v1alpha/scaffolds/init.go b/pkg/quarkus/v1alpha/scaffolds/init.go index 5eb6860..96bbec6 100644 --- a/pkg/quarkus/v1alpha/scaffolds/init.go +++ b/pkg/quarkus/v1alpha/scaffolds/init.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 scaffolds import ( diff --git a/pkg/quarkus/v1alpha/scaffolds/internal/templates/applicationproperties.go b/pkg/quarkus/v1alpha/scaffolds/internal/templates/applicationproperties.go index ee947d6..628fba1 100644 --- a/pkg/quarkus/v1alpha/scaffolds/internal/templates/applicationproperties.go +++ b/pkg/quarkus/v1alpha/scaffolds/internal/templates/applicationproperties.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 templates import ( diff --git a/pkg/quarkus/v1alpha/scaffolds/internal/templates/controller/controller.go b/pkg/quarkus/v1alpha/scaffolds/internal/templates/controller/controller.go index 8a09613..1f32572 100644 --- a/pkg/quarkus/v1alpha/scaffolds/internal/templates/controller/controller.go +++ b/pkg/quarkus/v1alpha/scaffolds/internal/templates/controller/controller.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 controller import ( diff --git a/pkg/quarkus/v1alpha/scaffolds/internal/templates/doc.go b/pkg/quarkus/v1alpha/scaffolds/internal/templates/doc.go index 5e87b58..739de41 100644 --- a/pkg/quarkus/v1alpha/scaffolds/internal/templates/doc.go +++ b/pkg/quarkus/v1alpha/scaffolds/internal/templates/doc.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 templates contains the files which have templates for the files being output by the scaffolders. */ diff --git a/pkg/quarkus/v1alpha/scaffolds/internal/templates/gitignore.go b/pkg/quarkus/v1alpha/scaffolds/internal/templates/gitignore.go index 4463363..a478c66 100644 --- a/pkg/quarkus/v1alpha/scaffolds/internal/templates/gitignore.go +++ b/pkg/quarkus/v1alpha/scaffolds/internal/templates/gitignore.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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. + /* Copyright 2018 The Kubernetes Authors. Modifications copyright 2020 The Operator-SDK Authors diff --git a/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/model.go b/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/model.go index c8f837a..1d191e7 100644 --- a/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/model.go +++ b/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/model.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 model import ( diff --git a/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/modelspec.go b/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/modelspec.go index af457a1..bfb2cbe 100644 --- a/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/modelspec.go +++ b/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/modelspec.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 model import ( diff --git a/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/modelstatus.go b/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/modelstatus.go index 2a7e8ae..f8cab5f 100644 --- a/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/modelstatus.go +++ b/pkg/quarkus/v1alpha/scaffolds/internal/templates/model/modelstatus.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 model import ( diff --git a/pkg/quarkus/v1alpha/scaffolds/internal/templates/operatorfile.go b/pkg/quarkus/v1alpha/scaffolds/internal/templates/operatorfile.go index 47e89e1..7604452 100644 --- a/pkg/quarkus/v1alpha/scaffolds/internal/templates/operatorfile.go +++ b/pkg/quarkus/v1alpha/scaffolds/internal/templates/operatorfile.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 templates import ( diff --git a/pkg/quarkus/v1alpha/scaffolds/internal/templates/pomxml.go b/pkg/quarkus/v1alpha/scaffolds/internal/templates/pomxml.go index 907f375..691f9ad 100644 --- a/pkg/quarkus/v1alpha/scaffolds/internal/templates/pomxml.go +++ b/pkg/quarkus/v1alpha/scaffolds/internal/templates/pomxml.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 templates import ( diff --git a/pkg/quarkus/v1alpha/scaffolds/internal/templates/util/file.go b/pkg/quarkus/v1alpha/scaffolds/internal/templates/util/file.go index 6544e0f..06c129f 100644 --- a/pkg/quarkus/v1alpha/scaffolds/internal/templates/util/file.go +++ b/pkg/quarkus/v1alpha/scaffolds/internal/templates/util/file.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 util import ( diff --git a/pkg/quarkus/v1alpha/util/util.go b/pkg/quarkus/v1alpha/util/util.go index 5540251..07ddbdc 100644 --- a/pkg/quarkus/v1alpha/util/util.go +++ b/pkg/quarkus/v1alpha/util/util.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 util import "strings" diff --git a/pkg/quarkus/v1alpha/util/util_suite_test.go b/pkg/quarkus/v1alpha/util/util_suite_test.go index 7ba4d22..7e4f747 100644 --- a/pkg/quarkus/v1alpha/util/util_suite_test.go +++ b/pkg/quarkus/v1alpha/util/util_suite_test.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 util import ( diff --git a/pkg/quarkus/v1alpha/util/util_test.go b/pkg/quarkus/v1alpha/util/util_test.go index 47df4a1..d0f5d88 100644 --- a/pkg/quarkus/v1alpha/util/util_test.go +++ b/pkg/quarkus/v1alpha/util/util_test.go @@ -1,3 +1,17 @@ +// Copyright 2021 The Operator-SDK Authors +// +// 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 util import (