mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 07:25:18 +00:00
[#2822] add check-for-json-errors-in-doc.sh to CI
This commit is contained in:
@@ -112,6 +112,16 @@ shellcheck:
|
|||||||
- SCRIPTS+="tools/tests_in_valgrind.sh "
|
- SCRIPTS+="tools/tests_in_valgrind.sh "
|
||||||
- shellcheck ${SCRIPTS} ${SHELLCHECK_OPTS}
|
- shellcheck ${SCRIPTS} ${SHELLCHECK_OPTS}
|
||||||
|
|
||||||
|
are-database-scripts-in-sync:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- ./src/share/database/scripts/utils/are-scripts-in-sync.py
|
||||||
|
|
||||||
|
check-for-json-errors-in-doc:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- ./tools/check-for-json-errors-in-doc.sh
|
||||||
|
|
||||||
danger:
|
danger:
|
||||||
stage: test
|
stage: test
|
||||||
before_script:
|
before_script:
|
||||||
@@ -122,12 +132,6 @@ danger:
|
|||||||
script:
|
script:
|
||||||
- danger --fail-on-errors=true --new-comment
|
- danger --fail-on-errors=true --new-comment
|
||||||
|
|
||||||
dhcpdb_create-upgrade-consistency:
|
|
||||||
allow_failure: false
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- ./src/share/database/scripts/utils/are-scripts-in-sync.py
|
|
||||||
|
|
||||||
duplicate-includes:
|
duplicate-includes:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
|
@@ -1,14 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Usage:
|
||||||
|
# check-for-json-errors-in-doc.sh [--all] [<file1>, <file2>, ...]
|
||||||
|
|
||||||
# Change directory to the root of the repository.
|
# Change directory to the root of the repository.
|
||||||
script_path=$(cd "$(dirname "${0}")" && pwd)
|
script_path=$(cd "$(dirname "${0}")" && pwd)
|
||||||
cd "${script_path}/.."
|
cd "${script_path}/.."
|
||||||
|
|
||||||
# Parse parameters.
|
# Parse parameters.
|
||||||
if test ${#} -gt 0; then
|
if test ${#} -gt 0; then
|
||||||
files="${*}"
|
if test "${1}" = '--all'; then
|
||||||
|
files='doc src'
|
||||||
|
else
|
||||||
|
files="${*}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
files='doc src'
|
# By default, check only modified files.
|
||||||
|
files=$(git diff --name-only $(git merge-base origin/master HEAD))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit_code=0
|
||||||
|
|
||||||
# Get the files.
|
# Get the files.
|
||||||
files=$(find ${files} -type f \( -name '*.rst' -or -name '*.json' \) -and -not -path '*/_build/*' -and -not -path '*/man/*' | sort)
|
files=$(find ${files} -type f \( -name '*.rst' -or -name '*.json' \) -and -not -path '*/_build/*' -and -not -path '*/man/*' | sort)
|
||||||
work_file=$(mktemp)
|
work_file=$(mktemp)
|
||||||
@@ -48,6 +60,7 @@ for file in $files; do
|
|||||||
echo "===start of JSON block==="
|
echo "===start of JSON block==="
|
||||||
cat $work_file
|
cat $work_file
|
||||||
echo "====end of JSON block===="
|
echo "====end of JSON block===="
|
||||||
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ $comment -eq 0 -a $json -eq 1 ]; then
|
if [ $comment -eq 0 -a $json -eq 1 ]; then
|
||||||
@@ -86,7 +99,10 @@ for file in $files; do
|
|||||||
echo "===start of JSON block==="
|
echo "===start of JSON block==="
|
||||||
cat $work_file
|
cat $work_file
|
||||||
echo "====end of JSON block===="
|
echo "====end of JSON block===="
|
||||||
|
exit_code=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
rm $work_file
|
rm $work_file
|
||||||
|
|
||||||
|
exit ${exit_code}
|
||||||
|
Reference in New Issue
Block a user