Skip to content

Commit b80bd6d

Browse files
Merge pull request #49756 from aireilly/fix-spurious-vale-error
Fixes spurious vale check error for deleted files
2 parents bb909c9 + 86aef89 commit b80bd6d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/check-with-vale.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
set -e
44

5-
# list of *.adoc files ignoring files in /rest_api and generated files
6-
FILES=$(git diff-tree HEAD HEAD~1 --no-commit-id -r --name-only "*.adoc" ':(exclude)rest_api/*' ':(exclude)modules/example-content.adoc' ':(exclude)modules/oc-adm-by-example-content.adoc')
5+
# list of *.adoc files excluding files in /rest_api, generated files, and deleted files
6+
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')
77

8-
if [ -n "${FILES}" ]
8+
if [ -n "${FILES}" ] ;
99
then
1010
echo "Validating language usage in added or modified asciidoc files with $(vale -v)"
1111
echo ""
@@ -16,8 +16,9 @@ if [ -n "${FILES}" ]
1616
#clean out conditional markup
1717
sed -i -e 's/ifdef::.*\|ifndef::.*\|ifeval::.*\|endif::.*/ /' ${FILES}
1818
vale ${FILES} --minAlertLevel=error --glob='*.adoc' --no-exit
19-
#run again, and this time send to pipedream
19+
echo ""
2020
set -x
21+
#run again, and this time send to pipedream
2122
PR_DATA=''
2223
if [ "$1" == false ] ; then
2324
PR_DATA='{"PR": [{"Number": "None", "SHA": "None"}],'

0 commit comments

Comments
 (0)