mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 20:50:24 +00:00
Fix verification scripts to actually look at all go files.
This commit is contained in:
@@ -14,19 +14,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
REPO_ROOT="$(realpath "$(dirname $0)/..")"
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/../" && pwd -P)"
|
||||
|
||||
result=0
|
||||
|
||||
dirs=("pkg" "cmd")
|
||||
|
||||
for dir in ${dirs[@]}; do
|
||||
for file in $(grep -r -l "" "${REPO_ROOT}/${dir}/" | grep "[.]go"); do
|
||||
if [[ "$(${REPO_ROOT}/hooks/boilerplate.sh "${file}")" -eq "0" ]]; then
|
||||
echo "Boilerplate header is wrong for: ${file}"
|
||||
result=1
|
||||
fi
|
||||
done
|
||||
gofiles="$(find ${REPO_ROOT} -type f | grep "[.]go$" | grep -v "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}"
|
||||
result=1
|
||||
fi
|
||||
done
|
||||
|
||||
dirs=("cluster" "hack" "hooks")
|
||||
|
Reference in New Issue
Block a user