Skip to content

Commit 41c0848

Browse files
author
markzegarelli
authored
Some lightweight grammar checks (#2505)
* Some lightweight grammar checks * update version * check an updated file * Update relative link check * only annotate modified lines
1 parent 5965eb7 commit 41c0848

15 files changed

+178
-1
lines changed

.github/.vale.ini

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
StylesPath = .github/styles
2+
3+
Vocab = Docs
4+
5+
[*.md]
6+
BasedOnStyles = segment
7+
TokenIgnores = ({% .* %})

.github/Vocab/Docs/accept.txt

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
allowlist
2+
Appboy
3+
blocklist
4+
boolean
5+
CloudFront
6+
Cocoapods
7+
Gradle
8+
HTTP
9+
http
10+
HTTPS
11+
https
12+
Javadoc
13+
Javadocs
14+
Javascript
15+
Kameleoon
16+
Kissmetrics
17+
Littledata
18+
Middleware
19+
middleware
20+
Mixpanel
21+
Okta
22+
performant
23+
Preact
24+
Shopify
25+
Totango
26+
Twilio
27+
Vero
28+
WebKit
29+
Wootric
30+
Zendesk
31+
iOS
32+
ios
33+
Dev
34+
ga
35+
(?:G|g)tag
36+
(?:P|p)ageviews?\b
37+
(?:R|r)emarketing
38+
Doubleclick
39+
(?:C|c)annonical
40+
(?:U|u)rls?\b
41+
Optimizely
42+
Omnichannel
43+
namespace
44+
upsert
45+
viewability
46+
measurability
47+
Lightbox
48+
gmail
49+
(?:P|p)endo
50+
(?:K|k)laviyo
51+
(?:U|u)nmaps?\b
52+
(?:U|u)nlinks?\b
53+
(?:P|p)ostgres
54+
Smartly
55+
Hubspot
56+
Friendbuy
57+
Chargebee
58+
(?:L|l)ookback
59+
Subnet

.github/Vocab/Docs/reject.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
functionality
2+
e.g.
3+
i.e.
4+
signup
5+
setup
6+
login

.github/Vocab/Marketing/accept.txt

Whitespace-only changes.

.github/Vocab/Marketing/reject.txt

Whitespace-only changes.

.github/styles/segment/Latin.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: substitution
2+
message: "Use '%s' instead of '%s'."
3+
# link: https://docs.microsoft.com/en-us/style-guide/word-choice/use-us-spelling-avoid-non-english-words
4+
ignorecase: true
5+
level: error
6+
nonword: true
7+
8+
action:
9+
name: replace
10+
swap:
11+
'\b(?:eg|e\.g\.)[\s,]': for example
12+
'\b(?:ie|i\.e\.)[\s,]': that is, for example
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extends: substitution
2+
message: "Please use '%s' instead of '%s'."
3+
link: https://docs.microsoft.com/en-us/style-guide/punctuation/exclamation-points
4+
level: warning
5+
swap:
6+
'\w!\s': '\.'

.github/styles/segment/links.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extends: existence
2+
message: "Write meaningful link text."
3+
link: https://docs.microsoft.com/en-us/style-guide/urls-web-addresses
4+
level: warning
5+
raw:
6+
- '\[?here\]\('
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: existence
2+
message: 'Link to Segment docs "%s" must be relative.'
3+
level: warning
4+
scope: raw
5+
raw:
6+
- '\[.+\]\(https://(www.)?segment.com/docs.*\)'
7+

.github/styles/segment/subs.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
extends: substitution
2+
message: Please use '%s' instead of '%s'
3+
level: error
4+
ignorecase: true
5+
swap:
6+
blacklist: blocklist
7+
whitelist: allowlist
8+
utilize: use
9+
utilizes: uses
10+
utilizing: using
11+
leverage: use
12+
leverages: uses
13+
leveraging: using
14+
via: through, or using
15+
drop in: enter
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
extends: existence
2+
message: "Avoid using first-person like '%s'. Use Segment, a product name, or the other company name."
3+
# link: https://docs.microsoft.com/en-us/style-guide/grammar/person#avoid-first-person-plural
4+
level: warning
5+
ignorecase: true
6+
7+
tokens:
8+
- we
9+
- we'(?:ve|re)
10+
- ours?
11+
- our
12+
- us
13+
- let's
14+
# - their

.github/workflows/grammar-lint.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Linting
2+
on: [push]
3+
4+
jobs:
5+
prose:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@master
10+
11+
- name: Vale
12+
uses: errata-ai/vale-action@master
13+
with:
14+
# Optional
15+
# styles: |
16+
# https://github.com/errata-ai/Microsoft/releases/latest/download/Microsoft.zip
17+
# https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
18+
19+
# Optional
20+
# config: https://raw.githubusercontent.com/errata-ai/vale/master/.vale.ini
21+
22+
# Optional
23+
files: __onlyModified
24+
onlyAnnotateModifiedLines: true
25+
env:
26+
# Required, set by GitHub actions automatically:
27+
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
28+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

src/utils/vale-test.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Vale test
3+
hidden: true
4+
---
5+
This file will test various Vale styles we have installed (e.g. this exclamation point!) Neat!
6+
7+
Links to docs should be relative, for example [here](https://www.segment.com/docs/connections).
8+
9+
For example, like [this](/docs/connections)
10+
11+
segment.com/docs
12+
13+
Here's an update.
14+
15+

vale-styles/segment/links.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ extends: existence
22
message: "Write meaningful link text."
33
link: https://docs.microsoft.com/en-us/style-guide/urls-web-addresses
44
level: warning
5+
scope: link
56
raw:
67
- '\[?here\]\('

vale-styles/segment/relative-url.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ extends: existence
22
message: 'Link to Segment docs "%s" must be relative.'
33
level: warning
44
scope: raw
5+
nonword: true
56
raw:
6-
- '\[.+\]\(https://(www.)?segment.com/docs.*\)'
7+
- '(www.)?segment.com\/docs.*\)'
78

0 commit comments

Comments
 (0)