diff --git a/hack/verify-boilerplate.sh b/hack/verify-boilerplate.sh index 007f23a87f5..fdc14577178 100755 --- a/hack/verify-boilerplate.sh +++ b/hack/verify-boilerplate.sh @@ -46,6 +46,9 @@ files_need_boilerplate+=($(${boiler} "go" "${files[@]}")) files=($(find_files "sh")) files_need_boilerplate+=($(${boiler} "sh" "${files[@]}")) +files=($(find_files "py")) +files_need_boilerplate+=($(${boiler} "py" "${files[@]}")) + if [[ ${#files_need_boilerplate[@]} -gt 0 ]]; then for file in "${files_need_boilerplate[@]}"; do echo "Boilerplate header is wrong for: ${file}" diff --git a/hooks/boilerplate.py.txt b/hooks/boilerplate.py.txt new file mode 100755 index 00000000000..abc2e0e2b35 --- /dev/null +++ b/hooks/boilerplate.py.txt @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +# Copyright 2014 The Kubernetes Authors 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. + diff --git a/hooks/prepare-commit-msg b/hooks/prepare-commit-msg index 80a29ab934f..bfb6a07b77b 100755 --- a/hooks/prepare-commit-msg +++ b/hooks/prepare-commit-msg @@ -27,6 +27,12 @@ if [[ ${#files[@]} -gt 0 ]]; then files_need_boilerplate+=($("${boiler}" "sh" "${files[@]}")) fi +# Check for py files without the required boilerplate. +files=($(git diff --cached --name-only --diff-filter ACM | grep "\.py" | grep -v -e "third_party" -e "Godeps")) +if [[ ${#files} -gt 0 ]]; then + files_need_boilerplate+=($("${boiler}" "py" "${files[@]}")) +fi + # Check API schema definitions for field descriptions for file in $(git diff --cached --name-only --diff-filter ACM | egrep "pkg/api/v.[^/]*/types\.go" | grep -v "third_party"); do # Check for files with fields without description tags