Merge pull request #12992 from pmorie/description_checker

Make description checker check for descriptions in internal API
This commit is contained in:
Saad Ali
2015-08-20 17:32:44 -07:00
2 changed files with 20 additions and 14 deletions

View File

@@ -38,18 +38,24 @@ find_files() {
}
if [[ $# -eq 0 ]]; then
files=`find_files | egrep "pkg/api/v.[^/]*/types\.go"`
versioned_api_files=`find_files | egrep "pkg/api/v.[^/]*/types\.go"`
else
files=("${@}")
versioned_api_files=("${@}")
fi
for file in $files; do
for file in $versioned_api_files; do
if grep json: "${file}" | grep -v // | grep -v ,inline | grep -v -q description: ; then
echo "API file is missing the required field descriptions: ${file}"
result=1
fi
done
internal_types_file="${KUBE_ROOT}/pkg/api/types.go"
if grep json: "${internal_types_file}" | grep -v // | grep description: ; then
echo "Internal API types should not contain descriptions"
result=1
fi
exit ${result}
# ex: ts=2 sw=2 et filetype=sh