diff --git a/Makefile b/Makefile index 60bff994a..8a9446fb5 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,17 @@ +# Copyright 2017 The Kubernetes 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. + GO ?= go EPOCH_TEST_COMMIT ?= f2925f58acc259c4b894353f5fc404bdeb40028e PROJECT := github.com/kubernetes-incubator/cri-containerd @@ -25,7 +39,7 @@ ifndef GOPATH $(error GOPATH is not set) endif -verify: lint gofmt +verify: lint gofmt boiler lint: check-gopath @echo "checking lint" @@ -35,6 +49,10 @@ gofmt: @echo "checking gofmt" @./hack/verify-gofmt.sh +boiler: + @echo "checking boilerplate" + @./hack/repo-infra/verify/verify-boilerplate.sh + cri-containerd: check-gopath $(GO) build -o $(BUILD_DIR)/$@ \ $(PROJECT)/cmd/cri-containerd @@ -72,6 +90,7 @@ install.tools: .install.gitvalidation .install.gometalinter .PHONY: \ binaries \ + boiler \ clean \ default \ gofmt \ diff --git a/cmd/cri-containerd/cri_containerd.go b/cmd/cri-containerd/cri_containerd.go index 8917af8aa..175341506 100644 --- a/cmd/cri-containerd/cri_containerd.go +++ b/cmd/cri-containerd/cri_containerd.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/cri-containerd/options/options.go b/cmd/cri-containerd/options/options.go index 7838f118e..6fa0c5b94 100644 --- a/cmd/cri-containerd/options/options.go +++ b/cmd/cri-containerd/options/options.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors All rights reserved. +Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/hack/lint.sh b/hack/lint.sh index 9b10f6883..4f3326ac1 100755 --- a/hack/lint.sh +++ b/hack/lint.sh @@ -11,7 +11,7 @@ # 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.#!/usr/bin/env bash +# limitations under the License. set -o errexit set -o nounset diff --git a/hack/repo-infra/verify/boilerplate/boilerplate.py b/hack/repo-infra/verify/boilerplate/boilerplate.py index 3507c214c..8f60c8ae5 100755 --- a/hack/repo-infra/verify/boilerplate/boilerplate.py +++ b/hack/repo-infra/verify/boilerplate/boilerplate.py @@ -32,13 +32,13 @@ parser.add_argument( help="list of files to check, all files if unspecified", nargs='*') -# Rootdir defaults to the directory **above** the repo-infra dir. -rootdir = os.path.dirname(__file__) + "/../../../" +# Rootdir defaults to the directory **above** the hack/repo-infra dir. +rootdir = os.path.dirname(__file__) + "/../../../../" rootdir = os.path.abspath(rootdir) parser.add_argument( "--rootdir", default=rootdir, help="root directory to examine") -default_boilerplate_dir = os.path.join(rootdir, "repo-infra/verify/boilerplate") +default_boilerplate_dir = os.path.join(rootdir, "hack/repo-infra/verify/boilerplate") parser.add_argument( "--boilerplate-dir", default=default_boilerplate_dir) @@ -131,9 +131,9 @@ def file_passes(filename, refs, regexs): def file_extension(filename): return os.path.splitext(filename)[1].split(".")[-1].lower() -skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git', +skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git', 'cluster/env.sh', 'vendor', 'test/e2e/generated/bindata.go', - 'repo-infra/verify/boilerplate/test', '.glide'] + 'hack/repo-infra/verify/boilerplate/test', '.glide'] def normalize_files(files): newfiles = []