1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-03-28 14:56:28 +01:00

Check that all xml files in CDT are well formed (#1053)

This commit is contained in:
Jonah Graham 2025-01-22 16:38:40 -05:00 committed by GitHub
parent 9e04dc537b
commit c5cc700a2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 1 deletions

View file

@ -16,7 +16,7 @@ jobs:
image: quay.io/eclipse-cdt/cdt-infra-github@sha256:3d745b7b84e3f9f9492cc1d280ea3b44028a92c7e9748d1ea8771fed211b5dc4
options: -v ${{ github.workspace }}:/work
run: |
set -x
set -ex
cd /work
./releng/scripts/check_code_cleanliness_only.sh
./releng/scripts/check_bundle_versions.sh

View file

@ -56,3 +56,9 @@ echo "sure no dependencies on unexpected or newer libraries are accidentally"
echo "introduced."
${DIR}/check_dll_dependencies.sh
${DIR}/check_glibc_dependencies.sh
##
# Error out if some XML files are badly formed
##
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
${DIR}/check_xml_well_formed.sh

View file

@ -0,0 +1,23 @@
#!/bin/bash
###############################################################################
# Copyright (c) 2020, 2025 Kichwa Coders Canada Inc and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
###############################################################################
set -eu
exit_code=0
while read line; do
if ! xmllint $line > /dev/null; then
echo $line has badly formed XML;
exit_code=1
fi
done <<<$(git ls-files '**/*.xml')
exit ${exit_code}