adds boilerplate test to verify; cleanup boilerplate on a few files
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
This commit is contained in:
parent
07ad470bde
commit
f9e02affcc
21
Makefile
21
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 \
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
@ -133,7 +133,7 @@ def file_extension(filename):
|
||||
|
||||
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 = []
|
||||
|
Loading…
Reference in New Issue
Block a user