Skip to content

Commit 83da11b

Browse files
verify that files were not removed without changing sig.yaml
1 parent c11c027 commit 83da11b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

hack/verify-generated-docs.sh

+17-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ function cleanup {
2828
}
2929
trap cleanup EXIT
3030

31+
function get_interesting_files() {
32+
local dir=$1
33+
local files=$(ls ${dir}/sigs.yaml ${dir}/sig-*/README.md ${dir}/wg-*/README.md ${dir}/committee-*/README.md ${dir}/sig-list.md ${dir}/OWNERS_ALIASES)
34+
echo "$files"
35+
}
36+
3137
git archive --format=tar "$(git write-tree)" | (cd "${WORKING_DIR}" && tar xf -)
3238

3339
cd "${WORKING_DIR}"
@@ -36,14 +42,24 @@ make 1>/dev/null
3642
mismatches=0
3743
break=$(printf "=%.0s" $(seq 1 68))
3844

39-
for file in $(ls ${CRT_DIR}/sigs.yaml ${CRT_DIR}/sig-*/README.md ${CRT_DIR}/wg-*/README.md ${CRT_DIR}/committee-*/README.md ${CRT_DIR}/sig-list.md ${CRT_DIR}/OWNERS_ALIASES); do
45+
46+
real_files=$(get_interesting_files "$CRT_DIR")
47+
for file in $real_files; do
4048
real=${file#$CRT_DIR/}
4149
if ! diff -q ${file} ${WORKING_DIR}/${real} &>/dev/null; then
4250
echo "${file} does not match ${WORKING_DIR}/${real}";
4351
mismatches=$((mismatches+1))
4452
fi;
4553
done
4654

55+
real_files_count=$(echo "$real_files" | wc -w)
56+
working_dir_files_count=$(get_interesting_files "${WORKING_DIR}" | wc -l)
57+
58+
if [[ $real_files_count -ne $working_dir_files_count ]]; then
59+
echo "Mismatch: Number of generated files in does not match the number of files in the repository."
60+
mismatches=$((mismatches+1))
61+
fi
62+
4763
if [[ ${mismatches} -gt "0" ]]; then
4864
echo ""
4965
echo "${break}"

0 commit comments

Comments
 (0)