diff --git a/docs/sources/review/lint-prose/rules.md b/docs/sources/review/lint-prose/rules.md index 1183a48ac..a3c5b52f7 100755 --- a/docs/sources/review/lint-prose/rules.md +++ b/docs/sources/review/lint-prose/rules.md @@ -102,8 +102,8 @@ Use 'AM' or 'PM' (preceded by a space). _``_ was matched by one or more of the following regular expressions: -- `\d{1,2}[AP]M` -- `\d{1,2} ?[ap]m` +- `\d{1,2}[AP]M\b` +- `\d{1,2} ?[ap]m\b` - `\d{1,2} ?[aApP]\.[mM]\.` [More information ->](https://developers.google.com/style/word-list) @@ -165,47 +165,43 @@ Extends: substitution Consider using _``_ instead of _``_. -| Current text | Replacement text | -| ------------------------------ | ----------------------------- | -| `(?:alumnae\|alumni)` | `graduates` | -| `(?:alumna\|alumnus)` | `graduate` | -| `air(?:m[ae]n\|wom[ae]n)` | `pilot(s)` | -| `anchor(?:m[ae]n\|wom[ae]n)` | `anchor(s)` | -| `authoress` | `author` | -| `camera(?:m[ae]n\|wom[ae]n)` | `camera operator(s)` | -| `chair(?:m[ae]n\|wom[ae]n)` | `chair(s)` | -| `congress(?:m[ae]n\|wom[ae]n)` | `member(s) of congress` | -| `door(?:m[ae]\|wom[ae]n)` | `concierge(s)` | -| `draft(?:m[ae]n\|wom[ae]n)` | `drafter(s)` | -| `fire(?:m[ae]n\|wom[ae]n)` | `firefighter(s)` | -| `fisher(?:m[ae]n\|wom[ae]n)` | `fisher(s)` | -| `fresh(?:m[ae]n\|wom[ae]n)` | `first-year student(s)` | -| `garbage(?:m[ae]n\|wom[ae]n)` | `waste collector(s)` | -| `lady lawyer` | `lawyer` | -| `ladylike` | `courteous` | -| `landlord` | `building manager` | -| `mail(?:m[ae]n\|wom[ae]n)` | `mail carriers` | -| `man and wife` | `husband and wife` | -| `man enough` | `strong enough` | -| `mankind` | `human kind` | -| `manmade` | `manufactured` | -| `manpower` | `personnel` | -| `men and girls` | `men and women` | -| `middle(?:m[ae]n\|wom[ae]n)` | `intermediary` | -| `news(?:m[ae]n\|wom[ae]n)` | `journalist(s)` | -| `ombuds(?:man\|woman)` | `ombuds` | -| `oneupmanship` | `upstaging` | -| `poetess` | `poet` | -| `police(?:m[ae]n\|wom[ae]n)` | `police officer(s)` | -| `repair(?:m[ae]n\|wom[ae]n)` | `technician(s)` | -| `sales(?:m[ae]n\|wom[ae]n)` | `salesperson or sales people` | -| `service(?:m[ae]n\|wom[ae]n)` | `soldier(s)` | -| `steward(?:ess)?` | `flight attendant` | -| `tribes(?:m[ae]n\|wom[ae]n)` | `tribe member(s)` | -| `waitress` | `waiter` | -| `woman doctor` | `doctor` | -| `woman scientist[s]?` | `scientist(s)` | -| `work(?:m[ae]n\|wom[ae]n)` | `worker(s)` | +| Current text | Replacement text | +| ----------------------------- | ----------------------------- | +| `(?:alumnae\|alumni)` | `graduates` | +| `(?:alumna\|alumnus)` | `graduate` | +| `air(?:m[ae]n\|wom[ae]n)` | `pilot(s)` | +| `anchor(?:m[ae]n\|wom[ae]n)` | `anchor(s)` | +| `authoress` | `author` | +| `camera(?:m[ae]n\|wom[ae]n)` | `camera operator(s)` | +| `door(?:m[ae]\|wom[ae]n)` | `concierge(s)` | +| `draft(?:m[ae]n\|wom[ae]n)` | `drafter(s)` | +| `fire(?:m[ae]n\|wom[ae]n)` | `firefighter(s)` | +| `fisher(?:m[ae]n\|wom[ae]n)` | `fisher(s)` | +| `fresh(?:m[ae]n\|wom[ae]n)` | `first-year student(s)` | +| `garbage(?:m[ae]n\|wom[ae]n)` | `waste collector(s)` | +| `lady lawyer` | `lawyer` | +| `ladylike` | `courteous` | +| `mail(?:m[ae]n\|wom[ae]n)` | `mail carriers` | +| `man and wife` | `husband and wife` | +| `man enough` | `strong enough` | +| `mankind` | `human kind\|humanity` | +| `manmade` | `manufactured` | +| `manpower` | `personnel` | +| `middle(?:m[ae]n\|wom[ae]n)` | `intermediary` | +| `news(?:m[ae]n\|wom[ae]n)` | `journalist(s)` | +| `ombuds(?:man\|woman)` | `ombuds` | +| `oneupmanship` | `upstaging` | +| `poetess` | `poet` | +| `police(?:m[ae]n\|wom[ae]n)` | `police officer(s)` | +| `repair(?:m[ae]n\|wom[ae]n)` | `technician(s)` | +| `sales(?:m[ae]n\|wom[ae]n)` | `salesperson or sales people` | +| `service(?:m[ae]n\|wom[ae]n)` | `soldier(s)` | +| `steward(?:ess)?` | `flight attendant` | +| `tribes(?:m[ae]n\|wom[ae]n)` | `tribe member(s)` | +| `waitress` | `waiter` | +| `woman doctor` | `doctor` | +| `woman scientist[s]?` | `scientist(s)` | +| `work(?:m[ae]n\|wom[ae]n)` | `worker(s)` | [More information ->](https://developers.google.com/style/inclusive-documentation) @@ -217,7 +213,7 @@ _``_ doesn't need a hyphen. _``_ was matched by one or more of the following regular expressions: -- `\s[^\s-]+ly-` +- `\b[^\s-]+ly-\w+\b` [More information ->](https://developers.google.com/style/hyphens) diff --git a/vale/Grafana/styles/Grafana/GoogleAMPM.yml b/vale/Grafana/styles/Grafana/GoogleAMPM.yml index d9ead755e..41548350d 100644 --- a/vale/Grafana/styles/Grafana/GoogleAMPM.yml +++ b/vale/Grafana/styles/Grafana/GoogleAMPM.yml @@ -4,6 +4,6 @@ "message": "Use 'AM' or 'PM' (preceded by a space)." "nonword": true "tokens": - - "\\d{1,2}[AP]M" - - "\\d{1,2} ?[ap]m" + - "\\d{1,2}[AP]M\\b" + - "\\d{1,2} ?[ap]m\\b" - "\\d{1,2} ?[aApP]\\.[mM]\\." diff --git a/vale/Grafana/styles/Grafana/GoogleEmDash.yml b/vale/Grafana/styles/Grafana/GoogleEmDash.yml index c50c20c83..13236a660 100644 --- a/vale/Grafana/styles/Grafana/GoogleEmDash.yml +++ b/vale/Grafana/styles/Grafana/GoogleEmDash.yml @@ -1,7 +1,7 @@ "action": "name": "edit" "params": - - "remove" + - "trim" - " " "extends": "existence" "level": "error" diff --git a/vale/Grafana/styles/Grafana/GoogleGenderBias.yml b/vale/Grafana/styles/Grafana/GoogleGenderBias.yml index 56586b717..c5f08310d 100644 --- a/vale/Grafana/styles/Grafana/GoogleGenderBias.yml +++ b/vale/Grafana/styles/Grafana/GoogleGenderBias.yml @@ -12,8 +12,6 @@ "anchor(?:m[ae]n|wom[ae]n)": "anchor(s)" "authoress": "author" "camera(?:m[ae]n|wom[ae]n)": "camera operator(s)" - "chair(?:m[ae]n|wom[ae]n)": "chair(s)" - "congress(?:m[ae]n|wom[ae]n)": "member(s) of congress" "door(?:m[ae]|wom[ae]n)": "concierge(s)" "draft(?:m[ae]n|wom[ae]n)": "drafter(s)" "fire(?:m[ae]n|wom[ae]n)": "firefighter(s)" @@ -22,14 +20,12 @@ "garbage(?:m[ae]n|wom[ae]n)": "waste collector(s)" "lady lawyer": "lawyer" "ladylike": "courteous" - "landlord": "building manager" "mail(?:m[ae]n|wom[ae]n)": "mail carriers" "man and wife": "husband and wife" "man enough": "strong enough" - "mankind": "human kind" + "mankind": "human kind|humanity" "manmade": "manufactured" "manpower": "personnel" - "men and girls": "men and women" "middle(?:m[ae]n|wom[ae]n)": "intermediary" "news(?:m[ae]n|wom[ae]n)": "journalist(s)" "ombuds(?:man|woman)": "ombuds" diff --git a/vale/Grafana/styles/Grafana/GoogleHeadingPunctuation.yml b/vale/Grafana/styles/Grafana/GoogleHeadingPunctuation.yml index 83497997c..49ec04fa3 100644 --- a/vale/Grafana/styles/Grafana/GoogleHeadingPunctuation.yml +++ b/vale/Grafana/styles/Grafana/GoogleHeadingPunctuation.yml @@ -1,7 +1,7 @@ "action": "name": "edit" "params": - - "remove" + - "trim_right" - "." "extends": "existence" "level": "warning" diff --git a/vale/Grafana/styles/Grafana/GoogleLyHyphens.yml b/vale/Grafana/styles/Grafana/GoogleLyHyphens.yml index bdf6e7a00..dca73521c 100644 --- a/vale/Grafana/styles/Grafana/GoogleLyHyphens.yml +++ b/vale/Grafana/styles/Grafana/GoogleLyHyphens.yml @@ -1,7 +1,7 @@ "action": "name": "edit" "params": - - "replace" + - "regex" - "-" - " " "extends": "existence" @@ -11,4 +11,4 @@ "message": "'%s' doesn't need a hyphen." "nonword": true "tokens": - - "\\s[^\\s-]+ly-" + - "\\b[^\\s-]+ly-\\w+\\b" diff --git a/vale/Grafana/styles/Grafana/GoogleOptionalPlurals.yml b/vale/Grafana/styles/Grafana/GoogleOptionalPlurals.yml index 6e777a69d..a43d97de7 100644 --- a/vale/Grafana/styles/Grafana/GoogleOptionalPlurals.yml +++ b/vale/Grafana/styles/Grafana/GoogleOptionalPlurals.yml @@ -1,7 +1,7 @@ "action": "name": "edit" "params": - - "remove" + - "trim_right" - "(s)" "extends": "existence" "level": "error" diff --git a/vale/Makefile b/vale/Makefile index e227764c0..5bd8bd0a5 100644 --- a/vale/Makefile +++ b/vale/Makefile @@ -16,7 +16,7 @@ GIT_ROOT := $(shell git rev-parse --show-toplevel) DICTIONARIES := Grafana/styles/config/dictionaries/en_US-grafana.dic TESTS := fixtures/Grafana -STYLES := Grafana/styles/Grafana/GrafanaGoogle Grafana/styles/Grafana/Readability +STYLES := Grafana/styles/Grafana/Google Grafana/styles/Grafana/Readability RULES := Grafana/styles/Grafana/Acronyms.yml Grafana/styles/Grafana/AmazonProductNames.yml Grafana/styles/Grafana/ApacheProjectNames.yml Grafana/styles/Grafana/GoogleProductNames.yml Grafana/styles/Grafana/Headings.yml Grafana/styles/Grafana/ProductPossessives.yml Grafana/styles/Grafana/WordList.yml DOCUMENTATION := ../docs/sources/review/lint-prose/rules.md @@ -30,7 +30,7 @@ Grafana/styles/config/dictionaries/en_US-grafana.%: dictionary.libsonnet .PHONY: grafana/vale grafana/vale: ## Builds a container image for Vale with the Grafana style loaded. -grafana/vale: Grafana/styles/config/dictionaries/en_US-grafana.aff Grafana/styles/config/dictionaries/en_US-grafana.dic Grafana/styles/Grafana/GrafanaGoogle .vale.ini +grafana/vale: Grafana/styles/config/dictionaries/en_US-grafana.aff Grafana/styles/config/dictionaries/en_US-grafana.dic Grafana/styles/Grafana/Google .vale.ini $(PODMAN) build \ --platform linux/x86_64,linux/arm64 \ --progress plain \ @@ -60,9 +60,9 @@ sync: jsonnet -Se "(import '.vale.jsonnet').container" | sed '$${/^$$/d;}' > .vale.ini jsonnet -Se "(import '.vale.jsonnet').repository" | sed '$${/^$$/d;}' > ../.vale.ini -.PHONY: Grafana/styles/Grafana/GrafanaGoogle -Grafana/styles/Grafana/GrafanaGoogle: ## Generate the Grafana style from the Google style. -Grafana/styles/Grafana/GrafanaGoogle: google.jsonnet +.PHONY: Grafana/styles/Grafana/Google +Grafana/styles/Grafana/Google: ## Generate the Grafana style from the Google style. +Grafana/styles/Grafana/Google: google.jsonnet rm -f "$$(jsonnet -Se 'std.join(" ", std.objectFields(import "google.jsonnet"))')" jsonnet -S -m . google.jsonnet prettier -w $@*.yml diff --git a/vale/google.jsonnet b/vale/google.jsonnet index 6281d0ebd..329622f3a 100644 --- a/vale/google.jsonnet +++ b/vale/google.jsonnet @@ -1,47 +1,48 @@ std.prune({ - 'Grafana/styles/Grafana/GrafanaGoogleAMPM.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/AMPM.yml')), - // Replaced by Grafana/styles/GrafanaAcronyms.yml. - 'Grafana/styles/Grafana/GrafanaGoogleAcronyms.yml': null, + 'Grafana/styles/Grafana/GoogleAMPM.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/AMPM.yml')), + // Replaced by Grafana/Acronyms.yml. + 'Grafana/styles/Grafana/GoogleAcronyms.yml': null, // Not sure that this is that useful. - 'Grafana/styles/Grafana/GrafanaGoogleColons.yml': null, - 'Grafana/styles/Grafana/GrafanaGoogleContractions.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Contractions.yml')), - 'Grafana/styles/Grafana/GrafanaGoogleDateFormat.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/DateFormat.yml')), - 'Grafana/styles/Grafana/GrafanaGoogleEllipses.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Ellipses.yml')), - // Replaced by Grafana/styles/GrafanaExclamation.yml. - 'Grafana/styles/Grafana/GrafanaGoogleExclamation.yml': null, - 'Grafana/styles/Grafana/GrafanaGoogleFirstPerson.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/FirstPerson.yml')), - 'Grafana/styles/Grafana/GrafanaGoogleGender.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Gender.yml')), - 'Grafana/styles/Grafana/GrafanaGoogleGenderBias.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/GenderBias.yml')), - 'Grafana/styles/Grafana/GrafanaGoogleHeadingPunctuation.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/HeadingPunctuation.yml')), - // Replaced by Grafana/styles/GrafanaHeadings.yml. - 'Grafana/styles/Grafana/GrafanaGoogleHeadings.yml': null, - // Replaced by Grafana/styles/GrafanaLatin.yml. - 'Grafana/styles/Grafana/GrafanaGoogleLatin.yml': null, - 'Grafana/styles/Grafana/GrafanaGoogleLyHyphens.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/LyHyphens.yml')), - 'Grafana/styles/Grafana/GrafanaGoogleOptionalPlurals.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/OptionalPlurals.yml')), - // Replaced by Grafana/styles/GrafanaOrdinal.yml. - 'Grafana/styles/Grafana/GrafanaGoogleOrdinal.yml': null, - 'Grafana/styles/Grafana/GrafanaGoogleOxfordComma.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/OxfordComma.yml') { level: 'suggestion' }), - // Replaced by Grafana/styles/GrafanaParentheses.yml. - 'Grafana/styles/Grafana/GrafanaGoogleParens.yml': null, - 'Grafana/styles/Grafana/GrafanaGooglePassive.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Passive.yml')), - 'Grafana/styles/Grafana/GrafanaGooglePeriods.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Periods.yml')), + 'Grafana/styles/Grafana/GoogleColons.yml': null, + 'Grafana/styles/Grafana/GoogleContractions.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Contractions.yml')), + 'Grafana/styles/Grafana/GoogleDateFormat.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/DateFormat.yml')), + 'Grafana/styles/Grafana/GoogleEllipses.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Ellipses.yml')), + 'Grafana/styles/Grafana/GoogleEmDash.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/EmDash.yml')), + // Replaced by Grafana/Exclamation.yml. + 'Grafana/styles/Grafana/GoogleExclamation.yml': null, + 'Grafana/styles/Grafana/GoogleFirstPerson.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/FirstPerson.yml')), + 'Grafana/styles/Grafana/GoogleGender.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Gender.yml')), + 'Grafana/styles/Grafana/GoogleGenderBias.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/GenderBias.yml')), + 'Grafana/styles/Grafana/GoogleHeadingPunctuation.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/HeadingPunctuation.yml')), + // Replaced by Grafana/Headings.yml. + 'Grafana/styles/Grafana/GoogleHeadings.yml': null, + // Replaced by Grafana/Latin.yml. + 'Grafana/styles/Grafana/GoogleLatin.yml': null, + 'Grafana/styles/Grafana/GoogleLyHyphens.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/LyHyphens.yml')), + 'Grafana/styles/Grafana/GoogleOptionalPlurals.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/OptionalPlurals.yml')), + // Replaced by Grafana/Ordinal.yml. + 'Grafana/styles/Grafana/GoogleOrdinal.yml': null, + 'Grafana/styles/Grafana/GoogleOxfordComma.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/OxfordComma.yml') { level: 'suggestion' }), + // Replaced by Grafana/Parentheses.yml. + 'Grafana/styles/Grafana/GoogleParens.yml': null, + 'Grafana/styles/Grafana/GooglePassive.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Passive.yml')), + 'Grafana/styles/Grafana/GooglePeriods.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Periods.yml')), // Google.Quotes more often a false positive for usage. - 'Grafana/styles/Grafana/GrafanaGoogleQuotes.yml': null, - 'Grafana/styles/Grafana/GrafanaGoogleRanges.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Ranges.yml')), - 'Grafana/styles/Grafana/GrafanaGoogleSemicolons.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Semicolons.yml')), - 'Grafana/styles/Grafana/GrafanaGoogleSlang.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Slang.yml')), - 'Grafana/styles/Grafana/GrafanaGoogleSpacing.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Spacing.yml')), - 'Grafana/styles/Grafana/GrafanaGoogleSpelling.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Spelling.yml')), + 'Grafana/styles/Grafana/GoogleQuotes.yml': null, + 'Grafana/styles/Grafana/GoogleRanges.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Ranges.yml')), + 'Grafana/styles/Grafana/GoogleSemicolons.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Semicolons.yml')), + 'Grafana/styles/Grafana/GoogleSlang.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Slang.yml')), + 'Grafana/styles/Grafana/GoogleSpacing.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Spacing.yml')), + 'Grafana/styles/Grafana/GoogleSpelling.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Spelling.yml')), // More often than not, we need to be consistent with Prometheus units or units used Grafana UI which are not represented in the form encouraged by SI. - 'Grafana/styles/Grafana/GrafanaGoogleUnits.yml': null, - // Replaced by Grafana/styles/GrafanaWe.yml. - 'Grafana/styles/Grafana/GrafanaGoogleWe.yml': null, - 'Grafana/styles/Grafana/GrafanaGoogleWill.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Will.yml') { + 'Grafana/styles/Grafana/GoogleUnits.yml': null, + // Replaced by Grafana/We.yml. + 'Grafana/styles/Grafana/GoogleWe.yml': null, + 'Grafana/styles/Grafana/GoogleWill.yml': std.manifestYamlDoc(std.parseYaml(importstr 'Google/Will.yml') { message: super.message + '\n\n' + ||| Use present tense for statements that describe general behavior that's not associated with a particular time. |||, }), - // Replaced by Grafana/styles/GrafanaWordList.yml. - 'Grafana/styles/Grafana/GrafanaGoogleWordList.yml': null, + // Replaced by Grafana/WordList.yml. + 'Grafana/styles/Grafana/GoogleWordList.yml': null, })