Skip to content

Commit

Permalink
Update Vale rule to match OK style guidance
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Baldry <[email protected]>
  • Loading branch information
jdbaldry committed Jul 16, 2024
1 parent ddecbd4 commit d4b15b4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 23 deletions.
11 changes: 7 additions & 4 deletions docs/sources/review/lint-prose/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down Expand Up @@ -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

Expand Down
11 changes: 9 additions & 2 deletions vale/Grafana/OK.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
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:
- O.K.
- OK
- ok
- Ok
- Okay
- okay

- A-OK
- hokay
Expand Down
28 changes: 15 additions & 13 deletions vale/fixtures/Grafana/OK/testinvalid.golden
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions vale/fixtures/Grafana/OK/testinvalid.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Don't use:
- OK
- ok
- Ok
- okay
- Okay

Also avoid:

Expand Down
4 changes: 0 additions & 4 deletions vale/fixtures/Grafana/OK/testvalid.md
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
Instead use:

- Okay
- okay

0 comments on commit d4b15b4

Please sign in to comment.