Skip to content

Commit b56488c

Browse files
authored
[libc++] Improve the output of the generated-output CI job (#68903)
The step that checked for ignore_format.txt being consistent with the tree wouldn't print any explicit diagnostic when failing, which led to confusion. After this patch, an explicit diagnostic will be printed by the job along with the required diff to ignore_format.txt.
1 parent 9b89b80 commit b56488c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

libcxx/utils/ci/run-buildbot

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ check-generated-output)
209209
clean
210210
generate-cmake
211211

212+
set +x # Printing all the commands below just creates extremely confusing output
213+
212214
# Reject patches that forgot to re-run the generator scripts.
213215
echo "+++ Making sure the generator scripts were run"
214216
${NINJA} -vC "${BUILD_DIR}" libcxx-generate-files
@@ -222,20 +224,23 @@ check-generated-output)
222224
false
223225
fi
224226

227+
echo "+++ Making sure libcxx/utils/data/ignore_format.txt was updated appropriately"
228+
cp ${MONOREPO_ROOT}/libcxx/utils/data/ignore_format.txt ${BUILD_DIR}/before.txt
225229
${MONOREPO_ROOT}/libcxx/utils/generate_ignore_format.sh
226-
git diff | tee ${BUILD_DIR}/generated_output.patch
227-
git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status
228-
! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false
229-
if [ -s ${BUILD_DIR}/generated_output.status ]; then
230+
diff ${BUILD_DIR}/before.txt ${MONOREPO_ROOT}/libcxx/utils/data/ignore_format.txt | tee ${BUILD_DIR}/ignore_format.diff || true
231+
if [ -s ${BUILD_DIR}/ignore_format.diff ]; then
230232
echo "It looks like the list of not formatted files has changed."
231233
echo "If a file is now properly formatted with clang-format, remove the file name from "
232234
echo "libcxx/utils/data/ignore_format.txt. Otherwise you have to fix the"
233-
echo "formatting of some of the changed files."
235+
echo "formatting of some of the changed files. The diff above represents the "
236+
echo "changes that would be needed to ignore_format.txt to keep it representative "
237+
echo "of which files are mis-formatted in the project."
234238
false
235239
fi
236240

237241
# Reject patches that introduce non-ASCII characters or hard tabs.
238242
# Depends on LC_COLLATE set at the top of this script.
243+
set -x
239244
! grep -rn '[^ -~]' libcxx/include libcxx/src libcxx/test libcxx/benchmarks \
240245
--exclude '*.dat' \
241246
--exclude '*unicode*.cpp' \

0 commit comments

Comments
 (0)