Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ StylesPath = "vale/styles"

MinAlertLevel = suggestion

Packages = Google, Microsoft, alex
; Std is vendored (via `vale sync`) but not yet in BasedOnStyles below, so its
; rules don't run yet. It's Vale's new shared rule library (see
; https://vale.sh/blog/std) meant to de-duplicate rules Google/Microsoft both
; reimplement, e.g. Oxford comma, passive voice, sentence length. Adopting it
; to replace those overlapping rules is a deliberate follow-up, not done here.
Packages = Google, Microsoft, alex, Std
Vocab = Temporal

[*.{md,mdx}]
Expand Down
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ don't build in production at all, which 404s any inbound links). A page that's a
belongs in `bin/orphan-pages-baseline.json` with a note, rather than being silently ignored. See
[UTILITIES.md](./readme/UTILITIES.md) for details.

Vale linting (style):
Vale linting (style). Requires Vale 3.20+ (CI already runs 3.20.0; upgrade a local install with
`brew upgrade vale`) — `vale/styles/Std` needs it for its nested rule directories.

```bash
yarn lint:py # Example: lint Python SDK docs
Expand Down
76 changes: 76 additions & 0 deletions vale/styles/Std/Abbreviations/Acronyms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Extracted from errata-ai/Google (MIT). See NOTICE.
#
extends: conditional
message: "Spell out '%s' on first use."
level: suggestion
ignorecase: false
# Ensures that the existence of 'first' implies the existence of 'second'.
first: '\b([A-Z]{3,5})\b'
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
# ... with the exception of these:
exceptions:
- API
- ASP
- CLI
- CPU
- CSS
- CSV
- DEBUG
- DOM
- DPI
- FAQ
- GCC
- GDB
- GET
- GPU
- GTK
- GUI
- HTML
- HTTP
- HTTPS
- IDE
- JAR
- JSON
- JSX
- LESS
- LLDB
- NET
- NOTE
- NVDA
- OSS
- PATH
- PDF
- PHP
- POST
- RAM
- REPL
- RSA
- SCM
- SCSS
- SDK
- SQL
- SSH
- SSL
- SVG
- TBD
- TCP
- TODO
- URI
- URL
- USB
- UTF
- XML
- XSS
- YAML
- ZIP
tests:
- name: fires
input: >
Configure the DNS record before provisioning the VM.
want: |
1:15:Std.Abbreviations.Acronyms:Spell out 'DNS' on first use.

- name: clean
input: >
Configure the Domain Name System (DNS) record first, then the DNS zone.
want: ""
30 changes: 30 additions & 0 deletions vale/styles/Std/Abbreviations/Latin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Extracted from errata-ai/Google and errata-ai/IBM (MIT). See NOTICE.
#
# Google's boundary style (the lookahead doesn't swallow the following comma
# or space, and `$` catches abbreviations ending a heading or table cell),
# extended over IBM's larger list.
extends: substitution
message: "Use '%s' instead of '%s'."
level: suggestion
ignorecase: true
nonword: true
action:
name: replace
swap:
'\b(?:eg|e\.g\.)(?=[\s,;]|$)': for example
'\b(?:ie|i\.e\.)(?=[\s,;]|$)': that is
'\betc\.(?=[\s,;]|$)': and so on
'\bvs\.(?=[\s,;]|$)': versus
tests:
- name: fires
input: >
Use a tunnel, e.g. SSH, for internal services, i.e. anything private, etc.
want: |
1:15:Std.Abbreviations.Latin:Use 'for example' instead of 'e.g.'.
1:48:Std.Abbreviations.Latin:Use 'that is' instead of 'i.e.'.
1:71:Std.Abbreviations.Latin:Use 'and so on' instead of 'etc.'.

- name: clean
input: >
Use a tunnel, for example SSH, for internal services.
want: ""
22 changes: 22 additions & 0 deletions vale/styles/Std/DateTime/DateFormat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Extracted from errata-ai/Google (MIT). See NOTICE.
#
extends: existence
message: "Ambiguous date format: '%s'."
level: suggestion
ignorecase: true
nonword: true
tokens:
- '\d{1,2}(?:\.|/)\d{1,2}(?:\.|/)\d{4}'
- '\d{1,2} (?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?) \d{4}'
tests:
- name: fires
input: >
Support ends on 12/31/2026, which was announced on 5 January 2026.
want: |
1:17:Std.DateTime.DateFormat:Ambiguous date format: '12/31/2026'.
1:52:Std.DateTime.DateFormat:Ambiguous date format: '5 January 2026'.

- name: clean
input: >
Support ends on December 31, 2026.
want: ""
23 changes: 23 additions & 0 deletions vale/styles/Std/DateTime/TimeFormat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Extracted from errata-ai/Google (MIT). See NOTICE.
#
extends: existence
message: "Inconsistent time format: '%s'."
level: suggestion
nonword: true
tokens:
- '\d{1,2}[AP]M\b'
- '\d{1,2} ?[ap]m\b'
- '\d{1,2} ?[aApP]\.[mM]\.'
tests:
- name: fires
input: >
The job runs at 5PM and again at 6 am, then at 7 a.m.
want: |
1:17:Std.DateTime.TimeFormat:Inconsistent time format: '5PM'.
1:34:Std.DateTime.TimeFormat:Inconsistent time format: '6 am'.
1:48:Std.DateTime.TimeFormat:Inconsistent time format: '7 a.m.'.

- name: clean
input: >
The job runs at 5 PM and again at 6 AM.
want: ""
64 changes: 64 additions & 0 deletions vale/styles/Std/Grammar/Contractions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Extracted from errata-ai/Microsoft (MIT). See NOTICE.
#
extends: substitution
message: "Use '%s' instead of '%s'."
level: suggestion
ignorecase: true
action:
name: replace
swap:
are not: aren't
cannot: can't
could not: couldn't
did not: didn't
do not: don't
does not: doesn't
has not: hasn't
have not: haven't
how is: how's
is not: isn't

'it is(?!\.)': it's
'it''s(?=\.)': it is

should not: shouldn't

"that is(?![.,])": that's
'that''s(?=\.)': that is

'they are(?!\.)': they're
'they''re(?=\.)': they are

was not: wasn't

'we are(?!\.)': we're
'we''re(?=\.)': we are

'we have(?!\.)': we've
'we''ve(?=\.)': we have

were not: weren't

'what is(?!\.)': what's
'what''s(?=\.)': what is

'when is(?!\.)': when's
'when''s(?=\.)': when is

'where is(?!\.)': where's
'where''s(?=\.)': where is

will not: won't
tests:
- name: fires
input: >
Do not restart the host. It is not safe, and you cannot undo it.
want: |
1:1:Std.Grammar.Contractions:Use 'don't' instead of 'Do not'.
1:26:Std.Grammar.Contractions:Use 'it's' instead of 'It is'.
1:50:Std.Grammar.Contractions:Use 'can't' instead of 'cannot'.

- name: clean
input: >
Don't restart the host. It isn't safe.
want: ""
Loading