From 8c07a0f524377b3ac00177946c9808ab8acb8cd0 Mon Sep 17 00:00:00 2001 From: derekwaynecarr Date: Fri, 15 Aug 2014 11:17:00 -0400 Subject: [PATCH] Fix verify-boilerplate --- build/hello-kubernetes/hello.go | 16 ++++++++++++++++ hack/verify-boilerplate.sh | 2 +- hooks/boilerplate.sh | 4 ++-- pkg/util/time.go | 16 ++++++++++++++++ pkg/util/time_test.go | 16 ++++++++++++++++ 5 files changed, 51 insertions(+), 3 deletions(-) diff --git a/build/hello-kubernetes/hello.go b/build/hello-kubernetes/hello.go index 430c6497cba..9448015fe89 100644 --- a/build/hello-kubernetes/hello.go +++ b/build/hello-kubernetes/hello.go @@ -1,3 +1,19 @@ +/* +Copyright 2014 Google Inc. All rights reserved. + +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/hack/verify-boilerplate.sh b/hack/verify-boilerplate.sh index 67106146777..1f594df97ad 100755 --- a/hack/verify-boilerplate.sh +++ b/hack/verify-boilerplate.sh @@ -18,7 +18,7 @@ REPO_ROOT="$(cd "$(dirname "$0")/../" && pwd -P)" result=0 -gofiles="$(find ${REPO_ROOT} -type f | grep "[.]go$" | grep -v "third_party/\|release/\|output/\|target/")" +gofiles="$(find ${REPO_ROOT} -type f | grep "[.]go$" | grep -v "Godeps/\|third_party/\|release/\|output/\|target/")" for file in ${gofiles}; do if [[ "$(${REPO_ROOT}/hooks/boilerplate.sh "${file}")" -eq "0" ]]; then echo "Boilerplate header is wrong for: ${file}" diff --git a/hooks/boilerplate.sh b/hooks/boilerplate.sh index 1e68a9f7f05..1847d6eb41f 100755 --- a/hooks/boilerplate.sh +++ b/hooks/boilerplate.sh @@ -16,11 +16,11 @@ # Print 1 if the file in $1 has the correct boilerplate header, 0 otherwise. FILE=$1 -EXT=${FILE#*.} +EXT=${FILE##*.} REF_FILE="$(dirname $0)/boilerplate.${EXT}.txt" -if [[ ! -e "${REF_FILE}" ]]; then +if [ ! -e $REF_FILE ]; then echo "1" exit 0 fi diff --git a/pkg/util/time.go b/pkg/util/time.go index ad710b86367..2c4226f1c19 100644 --- a/pkg/util/time.go +++ b/pkg/util/time.go @@ -1,3 +1,19 @@ +/* +Copyright 2014 Google Inc. All rights reserved. + +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/util/time_test.go b/pkg/util/time_test.go index 0ad0d9f81f5..584b794844b 100644 --- a/pkg/util/time_test.go +++ b/pkg/util/time_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2014 Google Inc. All rights reserved. + +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 (