Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/code-cleanliness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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
23 changes: 23 additions & 0 deletions releng/scripts/check_xml_well_formed.sh
Original file line number Diff line number Diff line change
@@ -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}
Loading