diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index caf51cd9d2b..7495f15de64 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -91,3 +91,15 @@ jobs: config: .cspell.yaml suggestions: true treat_flagged_words_as_errors: true + + textlint: + runs-on: ubuntu-latest + steps: + - name: check out code + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + + - name: install dependencies + run: npm install + + - name: run textlint + run: make textlint format=github diff --git a/.textlintignore b/.textlintignore new file mode 100644 index 00000000000..ea5265d9e22 --- /dev/null +++ b/.textlintignore @@ -0,0 +1,4 @@ +.textlintrc.yml +.cspell/* +.github/** +spec-compliance-matrix.md diff --git a/.textlintrc.yml b/.textlintrc.yml new file mode 100644 index 00000000000..00f75576abe --- /dev/null +++ b/.textlintrc.yml @@ -0,0 +1,188 @@ +# cspell:ignore ebpf matic postgres protable +plugins: +filters: + allowlist: + allow: + # Don't check registry .yml file fields for language, repo,URL and tags: + - '/^\s*(?:language|repo|name|docs|url|website): .*$/m' + - /^(?:tags):(\s*-.+$)*/m + # Hugo template syntax: + - /{{.*?}}/ + - /{{%.*?%}}/ + # Custom header anchors in markdown headings: + - /{#.*?}/ + # src attribute in figure Hugo template: + - /src=".*?"/ + # Other: + - // # Raw URLs + - /\[.+\/\w+\]/ # Paths in square brackets to look like URLs +rules: + common-misspellings: + # Misspellings to be ignored (case-insensitive) + ignore: [] + period-in-header: true + terminology: + defaultTerms: true + skip: [] + exclude: + - 'bug[- ]fix(es)?' + - 'readme(s)?' + - 'to-?do(s)?(?=[ ,.])' + - "indexes\\b" + terms: + - Actix + - Ajax + - Apache + - API + - application/json + - AWS + - Azure + - Caml + - Cassandra + - Clojure + - CNCF + - eBPF + - ECMAScript + - Elixir + - Erlang + - GCP + - GitHub + - Gitpod + - GraphQL + - gRPC + - Haskell + - HTTP + - HTTPS + - ID + - iOS + - Istio + - Jaeger + - JavaScript + - JBoss + - Jetty + - JMX + - JSON + - Julia + - K8s + - Kafka + - KubeCon + - Kubernetes + - Laravel + - MacBook + - macOS + - Markdown + - MongoDB + - mTLS + - MySQL + - NDJSON + - Netlify + - NGINX + - OCaml + - OK + - OpAMP + - OpenSearch + - OpenTelemetry Collector + - OTel + - OTEP + - PDF + - Phoenix + - PHP + - PostgreSQL + - protobuf + - Python + - Quarkus + - Rails + - README + - Redis + - Ruby + - Rust + - SDK + - SemVer + - SQL + - SQLite + - Swift + - Symfony + - Thanos + - Traefik + - TypeScript + - UNIX + - URL + - WordPress + - WSGI + - YouTube + - Zend + - Zipkin + # + # ADVANCED RULES given as `[pattern, replacement]`, take as arguments to a + # search-and-replace of the form /pattern/replacement/. + # + # If the regex pattern starts with `(?<` or `(?=` or `(?!`, the + # terminology linter rule will use the regex AS IS to match strings in + # checked files. Otherwise, the pattern is wrapped into a regex with other + # constraints, such as requiring that is be at word boundaries. For + # details, see + # https://github.com/sapegin/textlint-rule-terminology/blob/ca36a645c56d21f27cb9d902b5fb9584030c59e3/index.js#L137-L142. + # + - ['3rd[- ]party', third-party] + - ['auto[- ]c(onfigur)(es?|ations?)', 'autoc$1$2'] # cSpell:disable-line + - ['back[- ]end(s)?', 'backend$1'] + - ['bugfix(es?)', 'bug fix$1'] + - [byte code, bytecode] + - ['(cloud)-(native)', '$1 $2'] + - [cpp, C++] + - # dotnet|.net -> .NET, but NOT for strings like: + # - File extension: file.net + # - Repo names: opentelemetry-dotnet + # - Compound names: System.Net.Http.HttpClient + - '(?<=(^|\s))(?:\bdot|\.)net\b' + - .NET + - [ebpf, eBPF] + - [epbf, eBPF] + - ['http[ /]?2(?:\.0)?', HTTP/2] + - [he(/| or )she, they] + - [\(s\)he, they] + - ["indices\\b", "indexes"] + - ["id['’]?s", IDs] + - # Capitalize Java, but NOT for strings like: + # - File names: file.java + # - Repo names: opentelemetry-java + # - Compound names: java.util.List + - '(?` + - `host:port/{zpage}/script.js` SHOULD return the frontend JavaScript code if these zPages uses client-side interaction. This MAY also be embedded in the HTML, but SHOULD be separated and linked in the page head using `