1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/scripts/check-with-vale.sh
aireilly a46492e642 fix vale in the CI
undo the file change
2022-12-05 21:33:19 +00:00

25 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -e
# list of *.adoc files excluding files in /rest_api, generated files, and deleted files
FILES=$(git diff --name-only HEAD~1 HEAD --diff-filter=d "*.adoc" ':(exclude)rest_api/*' ':(exclude)modules/example-content.adoc' ':(exclude)modules/oc-adm-by-example-content.adoc')
if [ -n "${FILES}" ] ;
then
echo "Validating language usage in added or modified asciidoc files with $(vale -v)"
echo ""
echo "==============================================================================================================================="
echo "Read about the error terms that cause the build to fail at https://redhat-documentation.github.io/vale-at-red-hat/docs/reference-guide/termserrors/"
echo "==============================================================================================================================="
if [ "$TRAVIS" = true ] ; then
#clean out conditional markup in Travis CI
sed -i -e 's/ifdef::.*\|ifndef::.*\|ifeval::.*\|endif::.*/ /' ${FILES}
vale ${FILES} --glob='*.adoc' --minAlertLevel=error
else
vale ${FILES} --glob='*.adoc' --minAlertLevel=suggestion
fi
else
echo "No asciidoc files added or modified."
fi