File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ MinAlertLevel = suggestion
4
4
5
5
Packages = RedHat, AsciiDoc, OpenShiftAsciiDoc
6
6
7
- Vocab = OpenShiftDocs
8
-
9
7
# Ignore files in dirs starting with `.` to avoid raising errors for `.vale/fixtures/*/testinvalid.adoc` files
10
8
[[!.] *.adoc]
11
9
BasedOnStyles = RedHat, AsciiDoc, OpenShiftAsciiDoc
12
10
11
+ Vocab = OpenShiftDocs
12
+
13
13
# Disabling rules (NO)
14
14
RedHat.ReleaseNotes = NO
15
15
Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ StylesPath = ../.vale/styles
2
2
3
3
MinAlertLevel = suggestion
4
4
5
- Vocab = OpenShiftDocs
6
-
7
5
[[!.] *.adoc]
8
6
BasedOnStyles = OpenShiftAsciiDoc, AsciiDoc, RedHat
9
7
8
+ Vocab = OpenShiftDocs
9
+
10
10
# Use local OpenShiftDocs Vocab terms
11
11
Vale.Terms = YES
12
12
Vale.Avoid = YES
Original file line number Diff line number Diff line change @@ -42,11 +42,18 @@ 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
+ # Check if Vale should use the modules config or the root config. Ensures correct rule enabling/disabling
46
+ if [[ $FILE == modules/* ]]; then
47
+ INI=" modules/.vale.ini"
48
+ else
49
+ INI=" .vale.ini"
50
+ fi
51
+
45
52
# Update conditional markup in place
46
53
sed -i ' s/ifdef::.*/ifdef::temp-ifdef[]/; s/ifeval::.*/ifeval::["{temp-ifeval}" == "temp"]/; s/ifndef::.*/ifndef::temp-ifndef[]/; s/endif::.*/endif::[]/;' " $FILE "
47
54
48
55
# Parse for vale errors
49
- vale_json=$( vale --minAlertLevel=error --output=.vale/templates/bot-comment-output.tmpl " $FILE " | jq)
56
+ vale_json=$( vale --minAlertLevel=error --output=.vale/templates/bot-comment-output.tmpl --config= " $INI " " $FILE " | jq)
50
57
51
58
# Check if there are Vale errors before processing the file further.
52
59
if [[ " $vale_json " != " []" ]]; then
You can’t perform that action at this time.
0 commit comments