From: Jonathan Boulle Date: Fri, 1 Apr 2016 13:35:21 +0000 (+0200) Subject: *: add missing license headers + check X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=f6135c7ba38fe82545322407a629d671e90b3ecc;p=cni.git *: add missing license headers + check --- diff --git a/pkg/invoke/delegate.go b/pkg/invoke/delegate.go index 9864e6f..0a8198c 100644 --- a/pkg/invoke/delegate.go +++ b/pkg/invoke/delegate.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 invoke import ( diff --git a/pkg/invoke/find_test.go b/pkg/invoke/find_test.go index 00baa31..4135538 100644 --- a/pkg/invoke/find_test.go +++ b/pkg/invoke/find_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 invoke_test import ( diff --git a/pkg/invoke/invoke_suite_test.go b/pkg/invoke/invoke_suite_test.go index e570c96..72eb837 100644 --- a/pkg/invoke/invoke_suite_test.go +++ b/pkg/invoke/invoke_suite_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 invoke_test import ( diff --git a/pkg/ns/ns_suite_test.go b/pkg/ns/ns_suite_test.go index ff26ec2..e2adaa4 100644 --- a/pkg/ns/ns_suite_test.go +++ b/pkg/ns/ns_suite_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 ns_test import ( diff --git a/pkg/ns/ns_test.go b/pkg/ns/ns_test.go index ad52f7f..d9f182c 100644 --- a/pkg/ns/ns_test.go +++ b/pkg/ns/ns_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 ns_test import ( diff --git a/pkg/skel/skel_suite_test.go b/pkg/skel/skel_suite_test.go index 4820d5d..df5a8e7 100644 --- a/pkg/skel/skel_suite_test.go +++ b/pkg/skel/skel_suite_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 skel import ( diff --git a/pkg/skel/skel_test.go b/pkg/skel/skel_test.go index c6fb4e8..4469564 100644 --- a/pkg/skel/skel_test.go +++ b/pkg/skel/skel_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 skel import ( diff --git a/pkg/types/args_test.go b/pkg/types/args_test.go index 123548c..23aaf81 100644 --- a/pkg/types/args_test.go +++ b/pkg/types/args_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 types_test import ( diff --git a/pkg/types/types_suite_test.go b/pkg/types/types_suite_test.go index b026169..2b178ce 100644 --- a/pkg/types/types_suite_test.go +++ b/pkg/types/types_suite_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 types_test import ( diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 7ec139f..33a2aa7 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 utils import ( diff --git a/pkg/utils/utils_suite_test.go b/pkg/utils/utils_suite_test.go index f160db6..ee614a7 100644 --- a/pkg/utils/utils_suite_test.go +++ b/pkg/utils/utils_suite_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 utils_test import ( diff --git a/pkg/utils/utils_test.go b/pkg/utils/utils_test.go index 91bb865..d703de4 100644 --- a/pkg/utils/utils_test.go +++ b/pkg/utils/utils_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 utils import ( diff --git a/plugins/main/loopback/loopback.go b/plugins/main/loopback/loopback.go index b4e06bd..dabe807 100644 --- a/plugins/main/loopback/loopback.go +++ b/plugins/main/loopback/loopback.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 main import ( diff --git a/plugins/main/loopback/loopback_suite_test.go b/plugins/main/loopback/loopback_suite_test.go index d261605..36d646a 100644 --- a/plugins/main/loopback/loopback_suite_test.go +++ b/plugins/main/loopback/loopback_suite_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 main_test import ( diff --git a/plugins/main/loopback/loopback_test.go b/plugins/main/loopback/loopback_test.go index 9436e9a..fbacc70 100644 --- a/plugins/main/loopback/loopback_test.go +++ b/plugins/main/loopback/loopback_test.go @@ -1,3 +1,17 @@ +// Copyright 2016 CNI 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 main_test import ( diff --git a/test b/test index a51a0e8..c02b360 100755 --- a/test +++ b/test @@ -65,4 +65,16 @@ if [ -n "${vetRes}" ]; then exit 255 fi +echo "Checking license header..." +licRes=$( + for file in $(find . -type f -iname '*.go' ! -path './vendor/*'); do + head -n1 "${file}" | grep -Eq "(Copyright|generated)" || echo -e " ${file}" + done +) +if [ -n "${licRes}" ]; then + echo -e "license header checking failed:\n${licRes}" + exit 255 +fi + + echo "Success"