1
0
mirror of https://github.com/ko-build/ko.git synced 2025-02-01 19:14:40 +02:00

Ignore cobra auto-generate comments in doc diff (#420)

spf13/cobra inserts comments with dates in generated Markdown files.

This change makes the presubmit check ignore those comments when
verifying that ko's Markdown docs are up-to-date.

Also fixes some `shellcheck` warnings.
This commit is contained in:
Halvard Skogsrud 2021-08-20 01:47:47 +10:00 committed by GitHub
parent 780c281292
commit 040b7c7698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,12 +20,13 @@ set -o pipefail
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
pushd ${PROJECT_ROOT}
pushd "${PROJECT_ROOT}"
trap popd EXIT
# Verify that all source files are correctly formatted.
find . -name "*.go" | grep -v vendor/ | xargs gofmt -d -e -l
# Verify that generated Markdown docs are up-to-date.
mkdir -p /tmp/gendoc && go run cmd/help/main.go --dir /tmp/gendoc
diff -Naur /tmp/gendoc/ doc/
tmpdir=$(mktemp -d)
go run cmd/help/main.go --dir "$tmpdir"
diff -Naur -I '###### Auto generated' "$tmpdir" doc/