Skip to content

Commit

Permalink
Check that all xml files in CDT are well formed
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahgraham committed Jan 22, 2025
1 parent 9e04dc5 commit 08f20b3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions releng/scripts/check_code_cleanliness_only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 22 additions & 0 deletions releng/scripts/check_xml_well_formed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/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
git ls-files -- '**/*.xml' | while read line; do
if ! xmllint $line > /dev/null; then
echo $line has badly formed XML;
exit_code=1
fi
done
exit ${exit_code}

0 comments on commit 08f20b3

Please sign in to comment.