mirror of
https://github.com/ko-build/ko.git
synced 2025-11-06 09:19:12 +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:
@@ -20,12 +20,13 @@ set -o pipefail
|
|||||||
|
|
||||||
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
|
||||||
pushd ${PROJECT_ROOT}
|
pushd "${PROJECT_ROOT}"
|
||||||
trap popd EXIT
|
trap popd EXIT
|
||||||
|
|
||||||
# Verify that all source files are correctly formatted.
|
# Verify that all source files are correctly formatted.
|
||||||
find . -name "*.go" | grep -v vendor/ | xargs gofmt -d -e -l
|
find . -name "*.go" | grep -v vendor/ | xargs gofmt -d -e -l
|
||||||
|
|
||||||
# Verify that generated Markdown docs are up-to-date.
|
# Verify that generated Markdown docs are up-to-date.
|
||||||
mkdir -p /tmp/gendoc && go run cmd/help/main.go --dir /tmp/gendoc
|
tmpdir=$(mktemp -d)
|
||||||
diff -Naur /tmp/gendoc/ doc/
|
go run cmd/help/main.go --dir "$tmpdir"
|
||||||
|
diff -Naur -I '###### Auto generated' "$tmpdir" doc/
|
||||||
|
|||||||
Reference in New Issue
Block a user