File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,11 @@ Vocab = OpenShiftDocs
11
11
BasedOnStyles = RedHat, AsciiDoc, OpenShiftAsciiDoc
12
12
13
13
# Optional: pass doc attributes to asciidoctor before linting
14
- # [asciidoctor]
15
- # openshift-enterprise = YES
14
+ # Temp values are used for Prow CI comment linting only
15
+ [asciidoctor]
16
+ temp-ifdef = YES
17
+ temp-ifndef = NO
18
+ temp-ifeval = temp
16
19
17
20
# Disabling rules (NO)
18
21
RedHat.ReleaseNotes = NO
Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ Vocab = OpenShiftDocs
7
7
[[!.] *.adoc]
8
8
BasedOnStyles = OpenShiftAsciiDoc, AsciiDoc, RedHat
9
9
10
+ # Temp values are used for Prow CI comment linting only
11
+ [asciidoctor]
12
+ temp-ifdef = YES
13
+ temp-ifndef = NO
14
+ temp-ifeval = temp
15
+
10
16
# Use local OpenShiftDocs Vocab terms
11
17
Vale.Terms = YES
12
18
Vale.Avoid = YES
Original file line number Diff line number Diff line change @@ -42,8 +42,10 @@ function get_vale_errors {
42
42
# Run vale with the custom template on updated files and determine if a review comment should be posted
43
43
for FILE in ${FILES} ;
44
44
do
45
- # Clean out conditional markup in place and parse for vale errors
46
- sed -i ' s/ifdef::.*\|ifndef::.*\|ifeval::.*\|endif::.*/ /' " $FILE "
45
+ # Update conditional markup in place
46
+ sed -i ' s/ifdef::.*/ifdef::temp-ifdef[]/; s/ifeval::.*/ifeval::["{temp-ifeval}" == "temp"]/; s/ifndef::.*/ifndef::temp-ifndef[]/; s/endif::.*/endif::[]/;' " $FILE "
47
+
48
+ # Parse for vale errors
47
49
vale_json=$( vale --minAlertLevel=error --output=.vale/templates/bot-comment-output.tmpl " $FILE " | jq)
48
50
49
51
# Check if there are Vale errors before processing the file further.
You can’t perform that action at this time.
0 commit comments