Skip to content
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

Add textlint for document #1715

Merged
merged 23 commits into from
Jul 1, 2022
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
19 changes: 19 additions & 0 deletions .github/workflows/reviewdog-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,22 @@ jobs:
language: en-US
disabled_rules: "DOUBLE_PUNCTUATION,WORD_CONTAINS_UNDERSCORE,ARROWS,CURRENCY,DASH_RULE,EN_QUOTES"
disabled_categories: "TYPOS,TYPOGRAPHY,STYLE"
textlint:
name: runner / textlint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node/npm
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install textlint
run: |
make textlint/ci/install
- name: textlint-github-pr-review
uses: tsuyoshicho/action-textlint@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
textlint_flags: "docs/**"
151 changes: 151 additions & 0 deletions .prh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
version: 1
# index: ann
# index: clojure
# index: docker
# index: flamegraph
# index: go
# index: grafana
# index: helm
# index: jaeger
# index: java
# index: jupyter
# index: knn
# index: kubernetes
# index: ngt
# index: ngtd
# index: node.js
# index: onnx
# index: pyroscope
# index: python
# index: qbg
# index: sdk
# index: uuid
# index: vald
rules:
- pattern: ann
expected: ANN
specs:
- from: planning
to: planning
- from: ann
to: ANN
options:
wordBoundary: true
- pattern: clojure
expected: Clojure
options:
wordBoundary: true
- pattern: docker
expected: Docker
options:
wordBoundary: true
- pattern: flamegraph
expected: Flamegraph
options:
wordBoundary: true
- pattern:
- Golang
- golang
- /go(?! to)/
expected: Go
options:
wordBoundary: true
specs:
- from: go
to: Go
- from: going
to: going
- from: go to
to: go to
- from: golang
to: Go
- from: algorithm
to: algorithm
- pattern: grafana
expected: Grafana
options:
wordBoundary: true
- pattern: helm
expected: Helm
options:
wordBoundary: true
- pattern: jaeger
expected: Jaeger
options:
wordBoundary: true
- pattern: java
expected: Java
options:
wordBoundary: true
- pattern:
- jupyter
- jupiter
expected: Jupyter
options:
wordBoundary: true
- pattern:
- knn
- KNN
- kNN
expected: _k_-NN
options:
wordBoundary: true
- pattern:
- kubernetes
- k8s
- K8s
expected: Kubernetes
options:
wordBoundary: true
- pattern: ngt
expected: NGT
specs:
- from: length
to: length
hlts2 marked this conversation as resolved.
Show resolved Hide resolved
- from: ngt
to: NGT
options:
wordBoundary: true
- pattern: ngtd
expected: NGTD
options:
wordBoundary: true
- pattern:
- node.js
- nodejs
expected: Node.js
- pattern:
- onnx
- ONNX
expected: ONNX
options:
wordBoundary: true
- pattern: pyroscope
expected: Pyroscope
options:
wordBoundary: true
- pattern: python
expected: Python
options:
wordBoundary: true
- pattern: qbg
expected: QBG
options:
wordBoundary: true
- pattern: sdk
expected: SDK
options:
wordBoundary: true
- pattern: uuid
options:
wordBoundary: true
expected: UUID
- pattern: vald
expected: Vald
options:
wordBoundary: true
specs:
- from: vald
to: Vald
- from: valdcli
to: valdcli
63 changes: 63 additions & 0 deletions .textlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"rules": {
"en-spell": {
"personalDictionary": [
"changelog",
"clj",
"config",
"crd",
"docker",
"errgroup",
"fastime",
"github",
"godoc",
"goimports",
"golang",
"golangci",
"goroutine",
"grafana",
"helm",
"homebrew",
"http",
hlts2 marked this conversation as resolved.
Show resolved Hide resolved
"https",
"idrequest",
"int32",
"jaeger",
"k3d",
"k3s",
"k8s",
"kubernetes",
"mevie",
"ngt",
"ngtd",
"onnx",
"operator",
"rerank",
"scalable",
"sdk",
"spotify",
"sptag",
"struct",
"subtest",
"uint32",
"unexported",
"upsert",
"uuid",
"uuid",
"vald",
"vectorize",
"vektor",
"wald",
]
},
"prh": {
"rulePaths": [
".prh.yaml"
]
},
"write-good": {
"passive": false,
"thereIs": false
}
}
}
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ tools/install: \
helm/install \
kind/install \
valdcli/install \
telepresence/install
telepresence/install \
textlint/install

.PHONY: update
## update deps, license, and run golines, gofumpt, goimports
Expand Down Expand Up @@ -510,6 +511,11 @@ lint: vet
vet:
$(call go-vet)

.PHONY: docs/lint
## run lint for document
docs/lint:
textlint docs/**/*.md

.PHONY: changelog/update
## update changelog
changelog/update:
Expand Down
9 changes: 9 additions & 0 deletions Makefile.d/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,12 @@ $(BINDIR)/protoc:
unzip -o /tmp/protoc.zip -d /usr/local 'include/*'
rm -f /tmp/protoc.zip
endif

.PHONY: textlint/install
textlint/install:
npm install -g textlint textlint-rule-en-spell textlint-rule-prh textlint-rule-write-good

.PHONY: textlint/ci/install
textlint/ci/install:
npm init -y
npm install --save-dev textlint textlint-rule-en-spell textlint-rule-prh textlint-rule-write-good