diff --git a/.cspell.yaml b/.cspell.yaml new file mode 100644 index 00000000000..2abee2da1de --- /dev/null +++ b/.cspell.yaml @@ -0,0 +1,109 @@ +# For settings, see +# https://www.streetsidesoftware.com/vscode-spell-checker/docs/configuration/ +version: '0.2' +language: en-US +caseSensitive: true +allowCompoundWords: true +useGitignore: true +import: + - https://cdn.jsdelivr.net/npm/@cspell/dict-people-names/cspell-ext.json +ignorePaths: + - '**/*.svg' + - '.*.yml' + - '.*.yaml' + - 'schemas/**' + - 'spec-compliance-matrix/*.yaml' + - 'oteps/assets/0225*.*' +patterns: + - name: CodeBlock + pattern: | + / + ^(\s*[~`]{3,}) # Matches 3 or more backticks or tildes to start a code block. + .* # all languages and options, e.g. shell {hl_lines=[12]} + [\s\S]*? # content + \1 # Matches the same symbol which started the match. + /igmx + - name: CodeName + pattern: | + / + ([~`]) # Matches a single backtick or tilde to start a code block. + [^~`]*? # Matches any characters except backticks or tildes, non-greedy. + \1 # Matches the same symbol which started the match. + /x + - name: Links + pattern: | + / + \[[^\]]+\] # Matches the link text inside square brackets [ ... ]. + \( # Match the opening parentheses for the URL. + [^)]+ # Matches any URL/path until the closing ) — works for both relative and absolute. + \) # Match the closing parentheses for the URL. + /x + - name: Redirect + pattern: | + / + redirect:.+$ # Matches any front-matter redirect line. + /mx +languageSettings: + - languageId: + - markdown + - yaml + ignoreRegExpList: + - CodeBlock + - CodeName + - Links + - Redirect +dictionaries: + # Local word lists + - en-words + # Programming languages and software terms + - cpp + - csharp + - dart + - django + - docker + - dotnet + - elixir + - flutter + - fsharp + - golang + - haskell + - html + - java + - julia + - k8s + - kotlin + - markdown + - node + - npm + - php + - python + - ruby + - rust + - scala + - softwareTerms + - swift + - typescript + # Other + - companies + - aws + - google + - people-names +words: + - BLRP + - Kubecon + - OpAMP + - OTCA + - OTEP + - OTTL + - cumulatives + - deser + - inclusivity + - oteps + - representivity + - relatedly + - Naur + - configurator + - relitigating + - IDCONTEXT + - pdata + - Dpanic diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 740b7f3d25a..8c19aef2304 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -85,5 +85,9 @@ jobs: - name: check out code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: run misspell - run: make misspell + - uses: streetsidesoftware/cspell-action@v8 + with: + incremental_files_only: false # check all files, not just changed files + config: .cspell.yaml + suggestions: true + treat_flagged_words_as_errors: true diff --git a/.gitignore b/.gitignore index f8b1a862c5e..d38fec6793f 100644 --- a/.gitignore +++ b/.gitignore @@ -22,9 +22,6 @@ bin # Vim .swp -# Misspell binary -internal/tools/bin - # Node.js files for tools (e.g. markdown-toc) node_modules/ package-lock.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000000..25b4eeb0e9a --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "streetsidesoftware.code-spell-checker", + "streetsidesoftware.code-spell-checker-cspell-bundled-dictionaries" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index c216d9b9ef9..e59cb0bd0d9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "rewrap.wrappingColumn": 80, "editor.rulers": [80], + "cSpell.autoFormatConfigFile": true, "markdownlint.config": { "MD004": false, "MD013": false, diff --git a/CHANGELOG.md b/CHANGELOG.md index bba0f1ead6c..ac4b3711057 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -213,7 +213,7 @@ release. ### Common -- OTLP Exporters may allow devs to prepend a product identifier in `User-Agent` header. +- OTLP Exporters may allow developers to prepend a product identifier in `User-Agent` header. ([#4560](https://github.com/open-telemetry/opentelemetry-specification/pull/4560)) - ⚠️ **IMPORTANT**: Extending the set of standard attribute value types is no longer a breaking change. ([#4614](https://github.com/open-telemetry/opentelemetry-specification/pull/4614)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7cf311fcafd..54e238e6eae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -104,7 +104,7 @@ checks directly. See: - [MarkdownStyle](#markdown-style) -- [Misspell Check](#misspell-check) +- [CSpell Check](#cspell-check) - Markdown link checking (docs TODO) ### Autoformatting @@ -120,7 +120,6 @@ You can also run these fixes individually. See: -- [Misspell Correction](#misspell-check) - Table Generation (docs TODO) ### Markdown style @@ -148,24 +147,14 @@ with the Node version of markdownlint. If you are using Visual Studio Code, you can also use the `fixAll` command of the [vscode markdownlint extension](https://github.com/DavidAnson/vscode-markdownlint). -### Misspell check +### CSpell check In addition, please make sure to clean up typos before you submit the change. To check for typos, run the following command: ```bash -make misspell -``` - -> [!NOTE] -> The `misspell` make target will also fetch and build the tool if -> necessary. You'll need [Go](https://go.dev) to build the spellchecker. - -To quickly fix typos, use - -```bash -make misspell-correction +make cspell ``` ## Updating the Compliance Matrix diff --git a/Makefile b/Makefile index 3c4758bb365..813ef45d9e8 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,5 @@ -# All documents to be used in spell check. -ALL_DOCS := $(shell find . -type f -name '*.md' -not -path './.github/*' -not -path './node_modules/*' -not -path '*semantic_conventions*' -not -name 'spec-compliance-matrix.md' | sort) PWD := $(shell pwd) -TOOLS_DIR := ./internal/tools -MISSPELL_BINARY=bin/misspell -MISSPELL = $(TOOLS_DIR)/$(MISSPELL_BINARY) - # Detect Python and pip commands PYTHON := $(shell command -v python3 2>/dev/null || command -v python 2>/dev/null) PIP := $(shell command -v pip3 2>/dev/null || command -v pip 2>/dev/null) @@ -28,18 +22,12 @@ SEMCONVGEN_VERSION=0.17.0 # TODO: add `yamllint` step to `all` after making sure it works on Mac. .PHONY: all -all: install-tools markdownlint markdown-link-check misspell - -$(MISSPELL): - cd $(TOOLS_DIR) && go build -o $(MISSPELL_BINARY) github.com/client9/misspell/cmd/misspell +all: install-tools markdownlint markdown-link-check cspell -.PHONY: misspell -misspell: $(MISSPELL) - $(MISSPELL) -error $(ALL_DOCS) - -.PHONY: misspell-correction -misspell-correction: $(MISSPELL) - $(MISSPELL) -w $(ALL_DOCS) +.PHONY: cspell +cspell: + @if ! npm ls cspell; then npm install; fi + npx cspell . --no-progress .PHONY: markdown-link-check markdown-link-check: @@ -104,14 +92,9 @@ yamllint: # Run all checks in order of speed / likely failure. .PHONY: check -check: misspell markdownlint markdown-link-check +check: cspell markdownlint markdown-link-check @echo "All checks complete" -# Attempt to fix issues / regenerate tables. -.PHONY: fix -fix: misspell-correction - @echo "All autofixes complete" - # Generate spec compliance matrix from YAML source .PHONY: compliance-matrix compliance-matrix: check-python @@ -120,6 +103,6 @@ compliance-matrix: check-python @echo "Compliance matrix generation complete" .PHONY: install-tools -install-tools: $(MISSPELL) +install-tools: npm install @echo "All tools installed" diff --git a/internal/tools/go.mod b/internal/tools/go.mod deleted file mode 100644 index aeac23a1d36..00000000000 --- a/internal/tools/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/open-telemetry/opentelemetry-specification/internal/tools - -go 1.12 - -require github.com/client9/misspell v0.3.4 diff --git a/internal/tools/go.sum b/internal/tools/go.sum deleted file mode 100644 index ee5948021f9..00000000000 --- a/internal/tools/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= diff --git a/internal/tools/tools.go b/internal/tools/tools.go deleted file mode 100644 index bfa021b18f5..00000000000 --- a/internal/tools/tools.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2019, OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// +build tools - -package tools - -// This file follows the recommendation at -// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module -// on how to pin tooling dependencies to a go.mod file. -// This ensures that all systems use the same version of tools in addition to regular dependencies. - -import ( - _ "github.com/client9/misspell/cmd/misspell" -) diff --git a/oteps/0149-exponential-histogram.md b/oteps/0149-exponential-histogram.md index acf2ab3f884..33fa426a961 100644 --- a/oteps/0149-exponential-histogram.md +++ b/oteps/0149-exponential-histogram.md @@ -45,7 +45,7 @@ message ExponentialBucketCounts { Notes: -* ExponentialBuckets will be added as "oneof" the bucket types in [#272](https://github.com/open-telemetry/opentelemetry-proto/pull/272) +* ExponentialBuckets will be added as "one-of" the bucket types in [#272](https://github.com/open-telemetry/opentelemetry-proto/pull/272) * Per [#257](https://github.com/open-telemetry/opentelemetry-proto/issues/257), only a histogram accepting "double" will be defined. * Per [#259](https://github.com/open-telemetry/opentelemetry-proto/issues/259), bucket counts type is "double". diff --git a/oteps/logs/0097-log-data-model.md b/oteps/logs/0097-log-data-model.md index f88bbcd5dc1..312efbc38c4 100644 --- a/oteps/logs/0097-log-data-model.md +++ b/oteps/logs/0097-log-data-model.md @@ -639,7 +639,7 @@ this data model.