Skip to content

Commit

Permalink
autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
zirain committed Jul 22, 2024
1 parent 20c2d39 commit f11300a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TEMP_DIR=$(mktemp -d -t crd-ref-docs-XXXXX)
DEFAULT_ARGS=(--log-level=ERROR --source-path="${SCRIPT_DIR}/test" --output-path="${TEMP_DIR}/out" --config="${SCRIPT_DIR}/test/config.yaml")
AUTO_FIX=${AUTO_FIX:-}

trap '[[ $TEMP_DIR ]] && rm -rf "$TEMP_DIR"' EXIT

Expand Down Expand Up @@ -88,6 +89,10 @@ run_test() {
if diff=$(diff -a -y --suppress-common-lines "${SCRIPT_DIR}/test/${expected}" "$actual"); then
echo "OK"
else
if [[ -n "$AUTO_FIX" ]]; then
echo "INFO: auto-fixing the output"
cp "$actual" "${SCRIPT_DIR}/test/${expected}"
fi
echo "ERROR: outputs differ with ${expected}"
echo ""
echo "$diff"
Expand Down
3 changes: 3 additions & 0 deletions test/hide.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Package v1 contains API Schema definitions for the webapp v1 API group
| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | |
| `a` _string_ | | | |
| `x` _string_ | | | |
| `value` _[JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#json-v1-apiextensions-k8s-io)_ | | | |


#### Embedded1
Expand All @@ -71,6 +72,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `x` _string_ | | | |
| `value` _[JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#json-v1-apiextensions-k8s-io)_ | | | |


#### EmbeddedX
Expand All @@ -88,6 +90,7 @@ _Appears in:_
| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `x` _string_ | | | |
| `value` _[JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#json-v1-apiextensions-k8s-io)_ | | | |


#### Guestbook
Expand Down

0 comments on commit f11300a

Please sign in to comment.