1
0
Fork 0
forked from docs/team-docs

ci: fix vale pipeline

This commit is contained in:
darknao 2023-06-24 21:05:10 +02:00
commit 31d1f24ebb
No known key found for this signature in database
33 changed files with 68 additions and 2436 deletions

View file

@ -36,12 +36,16 @@ code_quality:
VARH_REPO: "redhat-documentation/vale-at-red-hat"
VARH_BRANCH: "main"
before_script:
- apk add --no-cache curl asciidoctor python3
- |
curl -o vale2cc.py \
https://raw.githubusercontent.com/${VARH_REPO}/${VARH_BRANCH}/tools/vale2cc.py
# - apk update && apk add git
- vale sync
script:
- vale --no-exit --output=JSON . | python3 vale2cc.py > gl-code-quality-report.json
# list of updated/modified *.adoc files
# - FILES=$(git diff --name-only HEAD~1 HEAD --diff-filter=d "*.adoc")
# clean out conditions for wider vale coverage
# - sed -i -e 's/ifdef::.*\|ifndef::.*\|ifeval::.*\|endif::.*/ /' ${FILES}
# use a template to rearrange the vale JSON output
# run vale with `--no-exit` to pass the build with errors
- vale --no-exit --minAlertLevel=error --glob='*.adoc' --output="$(pwd)/vale-json.tmpl" . | sed "s/CI_COMMIT_SHA/$CI_COMMIT_SHA/g" > gl-code-quality-report.json
artifacts:
reports:
codequality: gl-code-quality-report.json