Skip to content

Commit 0c66155

Browse files
To1negitster
authored andcommitted
t0450: add allowlist for builtins with missing .adoc
Before we were silently skipping all builtins that don't have a matching .adoc file. This is overly loose and might skip documentation files when it shouldn't, for example when there was a typo in the filename. To ensure no new builtins are added without documentation, add an allowlist: t0450/adoc-missing. In this file only builtin commands that do *not* have a corresponding .adoc file shall be listed. If there is a mismatch, fail the test. This should force future contributions to either add an .adoc, or add the builtin name to the allowlist file. Signed-off-by: Toon Claes <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f175b34 commit 0c66155

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

t/t0450-txt-doc-vs-help.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,16 @@ do
112112
adoc="$(builtin_to_adoc "$builtin")" &&
113113
preq="$(echo BUILTIN_ADOC_$builtin | tr '[:lower:]-' '[:upper:]_')" &&
114114

115-
if test -f "$adoc"
115+
# if and only if *.adoc is missing, builtin shall be listed in t0450/adoc-missing
116+
result=success
117+
if grep -q "^$builtin$" "$TEST_DIRECTORY"/t0450/adoc-missing
116118
then
117119
test_set_prereq "$preq"
120+
result=failure
118121
fi &&
122+
test_expect_$result "$builtin appropriately marked as having missing .adoc" '
123+
test -f "$adoc"
124+
'
119125

120126
# *.adoc output assertions
121127
test_expect_success "$preq" "$builtin *.adoc SYNOPSIS has dashed labels" '

0 commit comments

Comments
 (0)