diff --git a/.github/workflows/reviewdog-markdown.yml b/.github/workflows/reviewdog-markdown.yml index fb0c39fd9b..2adf74a3eb 100644 --- a/.github/workflows/reviewdog-markdown.yml +++ b/.github/workflows/reviewdog-markdown.yml @@ -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/**" diff --git a/.prh.yaml b/.prh.yaml new file mode 100644 index 0000000000..9a1b19deb0 --- /dev/null +++ b/.prh.yaml @@ -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 + - 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 diff --git a/.textlintrc b/.textlintrc new file mode 100644 index 0000000000..fd75be3eb5 --- /dev/null +++ b/.textlintrc @@ -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", + "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 + } + } +} diff --git a/Makefile b/Makefile index 35b3929491..cea96de96c 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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: diff --git a/Makefile.d/tools.mk b/Makefile.d/tools.mk index b9a41ed314..b9ab1baf85 100644 --- a/Makefile.d/tools.mk +++ b/Makefile.d/tools.mk @@ -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