-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat(docs): add Coder.BrandNames Vale rule, enforce HashiCorp casing #25501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8985cae
0d41b53
631094b
18dca80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Coder.BrandNames - enforce canonical brand-name casing in prose. | ||
| # | ||
| # Vale's substitution rule applies in prose only; it skips fenced code | ||
| # blocks, inline code, and URLs by default. That means `hashicorp/kubernetes` | ||
| # (Terraform provider source) and `developer.hashicorp.com` (URL) stay | ||
| # untouched. The rule fires on body text and headings where the wrong | ||
| # casing appears as a normal word. | ||
| # | ||
| # Level: error. Each swap targets a brand whose owner publishes a | ||
| # canonical casing; "Hashicorp Vault" instead of "HashiCorp Vault" is | ||
| # objectively wrong, not a judgment call. The existing-content violation | ||
| # count is zero (cleanup landed in the previous commit), so this rule | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3 [CRF-4] "cleanup landed in the previous commit" is a temporal reference that dissolves after merge. After a squash merge, "the previous commit" doesn't exist. After a rebase merge, the SHA changes. The factual claim (violation count is zero) stands on its own. Drop the parenthetical: (Leorio)
|
||
| # can ship at error from day one. | ||
| # | ||
| # Adding a brand: append a key/value to the swap table below and audit | ||
| # the docs corpus for the wrong-casing variant. Keep the message template | ||
| # unchanged; the `%s` token interpolates the matched (wrong) text. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2 [CRF-2] The comment says "the Suggestion: (Leorio)
Comment on lines
+1
to
+17
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3 [CRF-7] The header comment is 17 lines for 11 lines of config. Roughly half restates identifiers or duplicates content from
The trap (false-positive scope) and why-not-what (error level) carry their weight. Trimmed draft that keeps both: # substitution rules skip code blocks, inline code, and URLs, so
# provider sources (hashicorp/kubernetes) and URLs are unaffected.
#
# Error from day one: brand casing is objectively right or wrong,
# and existing-content violations are zero.
#
# Adding a brand: append to swap, audit docs for violations.(Gon)
|
||
| extends: substitution | ||
| message: "Use '%s' instead of '%s' (brand-name casing)." | ||
| link: https://github.com/coder/coder/blob/main/docs/.style/style-guide.md#brand-names | ||
| level: error | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note [CRF-12] Worth knowing:
|
||
| ignorecase: false | ||
| nonword: false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P4 [CRF-8] No regression fixture for the rule. If someone later breaks the swap YAML or removes an entry, there's no automated check that the rule still fires on known-bad input. The "test" is the absence of violations in the corpus, which is indistinguishable from a broken rule that fires on nothing. Not this PR's debt (no Vale rule test infrastructure exists in the repo), but worth noting as the
|
||
| action: | ||
| name: replace | ||
| swap: | ||
| Hashicorp: HashiCorp | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3 [CRF-5] The swap table catches The stated fallback ( swap:
hashicorp: HashiCorp
Hashicorp: HashiCorp
HASHICORP: HashiCorp(Zoro P3, Hisoka Note)
|
||
| HASHICORP: HashiCorp | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| # Coder custom Vale rules | ||
|
|
||
| Custom Vale rules specific to Coder live here. Each rule is a YAML file | ||
| that Vale loads through the `BasedOnStyles = Coder` setting in the | ||
| repo-root `.vale.ini`. | ||
| Custom Vale rules specific to Coder live here. | ||
| Each rule is a YAML file that Vale loads through the `BasedOnStyles = Coder` setting in the repo-root `.vale.ini`. | ||
|
|
||
| This directory is intentionally empty for now. Follow-up PRs add rules | ||
| incrementally. Planned starter rules: | ||
| Active rules ship as YAML files in this directory. | ||
| See the matching sections in `docs/.style/style-guide.md` for the user-facing policy each rule enforces. | ||
| Follow-up PRs add rules incrementally. | ||
| Planned coverage: | ||
|
|
||
| - Dev Container terminology | ||
| - HashiCorp casing | ||
| - Limit "we" | ||
| - Limit `we` | ||
| - Setup vs set up, Quickstart casing | ||
| - Next steps vs Learn more | ||
| - Vale substitution rule scaffold | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit [CRF-9] "Vale substitution rule scaffold" is stale or ambiguous.
|
||
|
|
@@ -28,9 +28,8 @@ incrementally. Planned starter rules: | |
| - The rule is objectively correct (typo, brand-name casing, banned | ||
| substitution). | ||
| - The existing-content violation count for the rule reaches zero. | ||
| 4. A follow-up PR will add a parity CI check that verifies every rule | ||
| here has a matching section in `style-guide.md`. Add the section in | ||
| the same PR as the rule. | ||
| 4. A follow-up PR adds a parity CI check that verifies every rule here has a matching section in `style-guide.md`. | ||
| Add the section in the same PR as the rule. | ||
|
|
||
| ## Reference | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3 [CRF-6] The PR description's verification section says the rule "flags the 7 instances the cleanup commit fixes." Vale scopes to
[*.md]only (.vale.iniline 47); it can only flag the 5 Markdown instances. The 2manifest.jsonfixes are manual edits outside Vale's scope. The claim conflates Vale-flagged instances with manually-fixed entries. The correct statement is: Vale flags 5 instances; 2 additional instances inmanifest.jsonare fixed by hand. (Mafu-san)