Skip to content

Commit

Permalink
Ignore camel case in heading capitalization, add double slash and dou…
Browse files Browse the repository at this point in the history
…ble parentheses rules to Vale (opensearch-project#6165)

Signed-off-by: Fanit Kolchina <[email protected]>
  • Loading branch information
kolchfa-aws authored Jan 16, 2024
1 parent 130cd22 commit 51ac5bd
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/vale/styles/OpenSearch/HeadingCapitalization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ indicators:
- ")"
exceptions:
- k # ignores lowercase k-NN
- '[A-Z]{2,}' # ignores all acronyms
- '[A-Z]{2,}' # ignores all acronyms
- '([A-Z][a-z0-9]+){2,}' # ignores all camel case words
8 changes: 8 additions & 0 deletions .github/vale/styles/OpenSearch/LinksDoubleParentheses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: existence
message: "Remove double slashes from the link '%s'."
level: error
nonword: true
scope: raw
tokens:
- '\[.*\](\(){2,}.*(\)){1,}'
- '\[.*\](\(){1,}.*(\)){2,}'
7 changes: 7 additions & 0 deletions .github/vale/styles/OpenSearch/LinksDoubleSlash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: existence
message: "Remove double slashes from the link '%s'."
level: error
nonword: true
scope: raw
tokens:
- '\(\{\{site.url\}\}\{\{site.baseurl\}\}.*\/{2,}.*\)'
4 changes: 4 additions & 0 deletions .github/vale/tests/test-style-neg.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ This sentence tests Latin substitution through using Latin.

## This heading: Tests colons but fails capitalization

This sentence tests [links double parentheses]({{site.url}}{{site.baseurl}}/opensearch/).

This sentence tests [links double slash]({{site.url}}{{site.baseurl}}/opensearch/).

This sentence tests [links end slash]({{site.url}}{{site.baseurl}}/opensearch/).

This sentence tests [links mid slash]({{site.url}}{{site.baseurl}}/opensearch/).
Expand Down
4 changes: 4 additions & 0 deletions .github/vale/tests/test-style-pos.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ This sentence tests Latin substitution via using Latin.

## This heading: tests colons

This sentence tests [links double parentheses](({{site.url}}{{site.baseurl}}/opensearch/)).

This sentence tests [links double slash]({{site.url}}{{site.baseurl}}/opensearch//double-slash/).

This sentence tests [links end slash]({{site.url}}{{site.baseurl}}/opensearch).

This sentence tests [links mid slash]({{site.url}}{{site.baseurl}}opensearch).
Expand Down
2 changes: 2 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ OpenSearch.HeadingPunctuation = YES
OpenSearch.Inclusive = YES
OpenSearch.LatinismsElimination = YES
OpenSearch.LatinismsSubstitution = YES
OpenSearch.LinksDoubleParentheses = YES
OpenSearch.LinksDoubleSlash = YES
OpenSearch.LinksEndSlash = YES
OpenSearch.LinksMidSlash = YES
OpenSearch.LoginNoun = YES
Expand Down

0 comments on commit 51ac5bd

Please sign in to comment.