From d4b15b4c1a5a974be458885824dd79cfb05870c8 Mon Sep 17 00:00:00 2001 From: Jack Baldry Date: Tue, 16 Jul 2024 10:38:09 +0100 Subject: [PATCH] Update Vale rule to match OK style guidance Signed-off-by: Jack Baldry --- docs/sources/review/lint-prose/rules.md | 11 +++++--- vale/Grafana/OK.yml | 11 ++++++-- vale/fixtures/Grafana/OK/testinvalid.golden | 28 +++++++++++---------- vale/fixtures/Grafana/OK/testinvalid.md | 2 ++ vale/fixtures/Grafana/OK/testvalid.md | 4 --- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/docs/sources/review/lint-prose/rules.md b/docs/sources/review/lint-prose/rules.md index ac8dae01f..d6f84df0b 100755 --- a/docs/sources/review/lint-prose/rules.md +++ b/docs/sources/review/lint-prose/rules.md @@ -2,7 +2,7 @@ date: "2024-06-25" description: A description of every Grafana Labs prose linting rule. menuTitle: Rules -review_date: "2024-07-11" +review_date: "2024-07-16" title: Vale rules --- @@ -462,10 +462,13 @@ Use '%s' instead of '%s'. Extends: existence -Use okay instead of '%s' unless you are directly referencing the UI. -In that case, use [bold formatting](https://grafana.com/docs/writers-toolkit/write/style-guide/style-conventions/#bold). +Don't use any variation of okay in prose. +The exceptions are when you’re referencing or quoting: -[More information ->](https://grafana.com/docs/writers-toolkit/write/style-guide/word-list/#okay) +- A user interface +- HTTP status codes or other code + +[More information ->](https://grafana.com/docs/writers-toolkit/write/style-guide/word-list/#ok-okay) ### Grafana.ProductPossessives diff --git a/vale/Grafana/OK.yml b/vale/Grafana/OK.yml index 3186f7632..0f2fc9658 100644 --- a/vale/Grafana/OK.yml +++ b/vale/Grafana/OK.yml @@ -1,6 +1,11 @@ extends: existence -message: "Use okay instead of '%s'." -link: https://grafana.com/docs/writers-toolkit/write/style-guide/word-list/#okay +message: | + Don't use any variation of okay in prose. + The exceptions are when you’re referencing or quoting: + + - A user interface + - HTTP status codes or other code +link: https://grafana.com/docs/writers-toolkit/write/style-guide/word-list/#ok-okay level: warning ignorecase: false tokens: @@ -8,6 +13,8 @@ tokens: - OK - ok - Ok + - Okay + - okay - A-OK - hokay diff --git a/vale/fixtures/Grafana/OK/testinvalid.golden b/vale/fixtures/Grafana/OK/testinvalid.golden index 674313e3a..cc7e19021 100644 --- a/vale/fixtures/Grafana/OK/testinvalid.golden +++ b/vale/fixtures/Grafana/OK/testinvalid.golden @@ -1,13 +1,15 @@ -testinvalid.md:4:3:Grafana.OK:Use okay instead of 'OK'. -testinvalid.md:5:3:Grafana.OK:Use okay instead of 'ok'. -testinvalid.md:6:3:Grafana.OK:Use okay instead of 'Ok'. -testinvalid.md:10:3:Grafana.OK:Use okay instead of 'A-OK'. -testinvalid.md:11:3:Grafana.OK:Use okay instead of 'hokay'. -testinvalid.md:12:3:Grafana.OK:Use okay instead of 'k'. -testinvalid.md:13:3:Grafana.OK:Use okay instead of 'keh'. -testinvalid.md:14:3:Grafana.OK:Use okay instead of 'kk'. -testinvalid.md:15:3:Grafana.OK:Use okay instead of 'M'kay'. -testinvalid.md:16:3:Grafana.OK:Use okay instead of 'oka'. -testinvalid.md:17:3:Grafana.OK:Use okay instead of 'okeh'. -testinvalid.md:18:3:Grafana.OK:Use okay instead of 'Okie dokie'. -testinvalid.md:19:3:Grafana.OK:Use okay instead of 'Okily Dokily'. +testinvalid.md:4:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:5:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:6:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:7:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:8:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:12:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:13:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:14:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:15:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:16:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:17:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:18:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:19:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:20:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code +testinvalid.md:21:3:Grafana.OK:Don't use any variation of okay in prose. The exceptions are when you’re referencing or quoting: - A user interface - HTTP status codes or other code diff --git a/vale/fixtures/Grafana/OK/testinvalid.md b/vale/fixtures/Grafana/OK/testinvalid.md index 3bc50f9e6..bc8e1aa40 100644 --- a/vale/fixtures/Grafana/OK/testinvalid.md +++ b/vale/fixtures/Grafana/OK/testinvalid.md @@ -4,6 +4,8 @@ Don't use: - OK - ok - Ok +- okay +- Okay Also avoid: diff --git a/vale/fixtures/Grafana/OK/testvalid.md b/vale/fixtures/Grafana/OK/testvalid.md index 0ed4ad735..e69de29bb 100644 --- a/vale/fixtures/Grafana/OK/testvalid.md +++ b/vale/fixtures/Grafana/OK/testvalid.md @@ -1,4 +0,0 @@ -Instead use: - -- Okay -- okay