Skip to content

Commit 0abd5eb

Browse files
Add Vale configuration file and Grafana style guide (#2006)
* Add vale configuration and Grafana style guide * Remove local path to Grafana package
1 parent 6b50c38 commit 0abd5eb

File tree

99 files changed

+2832
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2832
-0
lines changed

.vale.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
StylesPath = vale/styles
2+
3+
MinAlertLevel = suggestion
4+
5+
# You'll need to update the Grafana package to point to a local copy
6+
# of the grafana/writers-toolkit /vale directory to succesfully run the
7+
# vale sync command.
8+
Packages = Grafana, https://github.com/errata-ai/Hugo/releases/download/v0.2.0/Hugo.zip
9+
10+
[*.{md}]
11+
BasedOnStyles = Grafana

vale/styles/.vale-config/1-Hugo.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[*.md]
2+
# Exclude `{{< ... >}}`, `{{% ... %}}`, [Who]({{< ... >}})
3+
TokenIgnores = ({{[%<] .* [%>]}}.*?{{[%<] ?/.* [%>]}}), \
4+
(\[.+\]\({{< .+ >}}\)), \
5+
({{[%<] .+ [%>]}})
6+
7+
# Exclude `{{< myshortcode `This is some <b>HTML</b>, ... >}}`
8+
BlockIgnores = (?sm)^({{[%<] [^{]*? [%>]}})\n$, \
9+
(?s) *({{< highlight [^>]* ?>}}.*?{{< ?/ ?highlight >}}), \
10+
({{[%<] .+ [%>]}})

vale/styles/Grafana/Acronyms.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
"exceptions":
2+
- "ADOT"
3+
- "API"
4+
- "APT"
5+
- "ARN"
6+
- "AWS"
7+
- "BPF"
8+
- "CLI"
9+
- "CORS"
10+
- "CPU"
11+
- "CRD"
12+
- "CSS"
13+
- "CSV"
14+
- "DNS"
15+
- "DOM"
16+
- "eBPF"
17+
- "FAQ"
18+
- "GNU"
19+
- "GPG"
20+
- "GPU"
21+
- "GUI"
22+
- "HTML"
23+
- "HTTP"
24+
- "HTTPS"
25+
- "IBM"
26+
- "IDE"
27+
- "JAR"
28+
- "JPG"
29+
- "JSON"
30+
- "JSX"
31+
- "LESS"
32+
- "NAT"
33+
- "OSS"
34+
- "OTLP"
35+
- "PDF"
36+
- "PHP"
37+
- "PNG"
38+
- "RAM"
39+
- "RBAC"
40+
- "RED"
41+
- "REPL"
42+
- "RHEL"
43+
- "RPM"
44+
- "RSA"
45+
- "SCM"
46+
- "SCSS"
47+
- "SDK"
48+
- "SEO"
49+
- "SHA-1"
50+
- "SQL"
51+
- "SSD"
52+
- "SSM"
53+
- "SSH"
54+
- "SSL"
55+
- "SSO"
56+
- "SUSE"
57+
- "SVG"
58+
- "TCP"
59+
- "TLS"
60+
- "TSDB"
61+
- "UI"
62+
- "UID"
63+
- "URI"
64+
- "URL"
65+
- "USB"
66+
- "UTC"
67+
- "UTF"
68+
- "UUID"
69+
- "UX"
70+
- "VPC"
71+
- "XML"
72+
- "YAML"
73+
- "ZIP"
74+
"extends": "conditional"
75+
"first": "\\b([A-Z]{3,5})\\b"
76+
"ignorecase": false
77+
"level": "suggestion"
78+
"link": "https://developers.google.com/style/abbreviations"
79+
"message": "Spell out '%s', if it's unfamiliar to the audience."
80+
"second": "(?:\\b[A-Z][a-z]+ )+\\(([A-Z]{3,5})\\)"

vale/styles/Grafana/Admin.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extends: substitution
2+
message: |
3+
Use '%s' instead of '%s' unless it's the name of the UI label like in the Grafana 'Admin' role.
4+
link: https://developers.google.com/style/word-list#admin
5+
level: warning
6+
ignorecase: false
7+
action:
8+
name: replace
9+
swap:
10+
admin: administrator

vale/styles/Grafana/Admonitions.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
extends: script
2+
message: |
3+
Prefer the `admonition` shortcode over blockquotes.
4+
5+
The admonition shortcode renders its content in a blockquote with consistent styling across the website.
6+
link: https://grafana.com/docs/writers-toolkit/write/shortcodes/#admonition
7+
scope: raw
8+
script: |
9+
text := import("text")
10+
11+
matches := []
12+
13+
for match in text.re_find(`(?i)> \*\*(?:note|warning|caution|tip):?\*\*`, scope, -1) {
14+
matches = append(matches, {begin: match[0].begin, end: match[0].end})
15+
}

vale/styles/Grafana/Agentless.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
extends: substitution
2+
message: |
3+
Use '%s' instead of '%s'.
4+
5+
Grafana Agent has been replaced by Grafana Alloy, so you shouldn't use agent-based terminology.
6+
7+
If you're talking about why and how to send signals directly from an application to Grafana Cloud, prefer no-collector to agentless.
8+
9+
This is consistent with [OTel documentation](https://opentelemetry.io/docs/collector/deployment/no-collector/).
10+
link: https://grafana.com/docs/writers-toolkit/write/style-guide/word-list/#no-collector
11+
level: warning
12+
action:
13+
name: replace
14+
swap:
15+
agentless: no-collector

vale/styles/Grafana/AllowsTo.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
extends: substitution
2+
message: |
3+
Did you mean '%s' instead of '%s'?
4+
5+
Allows to is a common wording error.
6+
level: warning
7+
ignorecase: false
8+
action:
9+
name: replace
10+
swap:
11+
allows to: allows you to|makes it possible to

vale/styles/Grafana/AltText.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extends: script
2+
message: All images must have alt text.
3+
link: https://grafana.com/docs/writers-toolkit/write/image-guidelines/#alt-text
4+
scope: raw
5+
script: |
6+
text := import("text")
7+
matches := []
8+
for match in text.re_find(`!\[\]\(.*?\)`, scope, -1) {
9+
matches = append(matches, {begin: match[0].begin, end: match[0].end})
10+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extends: substitution
2+
level: warning
3+
link: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/WhatIsCloudWatch.html
4+
message: Use '%s' instead of '%s'.
5+
6+
action:
7+
name: replace
8+
swap:
9+
AWS CloudWatch: Amazon CloudWatch
10+
aws CloudWatch: Amazon CloudWatch
11+
Cloudwatch: CloudWatch
12+
cloudwatch: CloudWatch
13+
cloudWatch: CloudWatch
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"extends": "conditional"
2+
"first": "\\b(ARN|CloudWatch|Data Firehose|Elastic Kubernetes Service|Firehose|Kinesis|Relational Database Service|SSM)\\b"
3+
"level": "warning"
4+
"link": "https://grafana.com/docs/writers-toolkit/write/style-guide/capitalization-punctuation/#amazon-products"
5+
"message": "Use the full Amazon product name in the first instance."
6+
"scope": "text"
7+
"second": "Amazon (ARN|CloudWatch|Data Firehose|Elastic Kubernetes Service|Firehose|Kinesis|Relational Database Service|SSM)"

0 commit comments

Comments
 (0)