From d10f60938c73c10629634aff4a0b0c2512b2489b Mon Sep 17 00:00:00 2001 From: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:00:11 -0500 Subject: [PATCH] Add explicit link rule (#9089) Signed-off-by: Fanit Kolchina --- .github/vale/styles/OpenSearch/LinksExplicit.yml | 8 ++++++++ .github/vale/tests/test-style-pos.md | 2 ++ .vale.ini | 1 + 3 files changed, 11 insertions(+) create mode 100644 .github/vale/styles/OpenSearch/LinksExplicit.yml diff --git a/.github/vale/styles/OpenSearch/LinksExplicit.yml b/.github/vale/styles/OpenSearch/LinksExplicit.yml new file mode 100644 index 0000000000..a734259a3a --- /dev/null +++ b/.github/vale/styles/OpenSearch/LinksExplicit.yml @@ -0,0 +1,8 @@ +extends: existence +message: "In links, use '{{site.url}}{{site.baseurl}}' instead of 'https://www.opensearch.org/docs/latest'." +level: error +nonword: true +scope: raw +tokens: + - '\]\(https:\/\/www.opensearch.org\/docs\/latest' + \ No newline at end of file diff --git a/.github/vale/tests/test-style-pos.md b/.github/vale/tests/test-style-pos.md index 1cf640f463..a8af5442d8 100644 --- a/.github/vale/tests/test-style-pos.md +++ b/.github/vale/tests/test-style-pos.md @@ -38,6 +38,8 @@ This sentence tests [links end slash]({{site.url}}{{site.baseurl}}/opensearch). This sentence tests [links mid slash]({{site.url}}{{site.baseurl}}opensearch). +This sentence tests [links explicit](https://www.opensearch.org/docs/latest/double-slash/). + This sentence tests log-in as a noun. To login, we test this as a verb. To test merge conflicts, remove tick marks in `<<<<<<< HEAD`. diff --git a/.vale.ini b/.vale.ini index 2fb470b9dc..ffd25e32e9 100644 --- a/.vale.ini +++ b/.vale.ini @@ -38,6 +38,7 @@ OpenSearch.LatinismsSubstitution = YES OpenSearch.LinksDoubleParentheses = YES OpenSearch.LinksDoubleSlash = YES OpenSearch.LinksEndSlash = YES +OpenSearch.LinksExplicit = YES OpenSearch.LinksMidSlash = YES OpenSearch.LoginNoun = YES OpenSearch.LoginVerb = YES