From 49f2afe45438aa01e210192af84b84d018be0409 Mon Sep 17 00:00:00 2001 From: James Thompson Date: Fri, 9 Jan 2026 11:33:35 +1100 Subject: [PATCH 1/2] Perform the tool switch to cspell --- .cspell.yaml | 109 ++++++++++++++++++ .github/workflows/checks.yaml | 8 +- .gitignore | 3 - .vscode/extensions.json | 6 + .vscode/settings.json | 1 + CHANGELOG.md | 2 +- CONTRIBUTING.md | 17 +-- Makefile | 31 ++--- internal/tools/go.mod | 5 - internal/tools/go.sum | 2 - internal/tools/tools.go | 27 ----- oteps/0149-exponential-histogram.md | 2 +- oteps/logs/0097-log-data-model.md | 2 +- oteps/metrics/0072-metric-observer.md | 2 +- .../4673-experimental-probability-sampling.md | 2 +- package.json | 2 + specification/logs/data-model-appendix.md | 2 +- 17 files changed, 140 insertions(+), 83 deletions(-) create mode 100644 .cspell.yaml create mode 100644 .vscode/extensions.json delete mode 100644 internal/tools/go.mod delete mode 100644 internal/tools/go.sum delete mode 100644 internal/tools/tools.go 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 53b9bb48573..90536ffe7f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -169,7 +169,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 8dc13c3fddc..317652cba76 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. MSGID string - Defines the type of the event. Part of event source identity. Example: "TCPIN" + Defines the type of the event. Part of event source identity. Example: `"TCPIN"` Name diff --git a/oteps/metrics/0072-metric-observer.md b/oteps/metrics/0072-metric-observer.md index 9b0d42aff70..0e92d909a68 100644 --- a/oteps/metrics/0072-metric-observer.md +++ b/oteps/metrics/0072-metric-observer.md @@ -107,7 +107,7 @@ Callbacks must not be called synchronously with application code via any OpenTelemetry API. This prevents the application from potentially deadlocking itself by being called synchronously from its own thread. Implementations that cannot provide this guarantee should prefer not -to implement Observer instrsuments. +to implement Observer instruments. Callbacks may be called synchronously in the SDK on behalf of an exporter, provided it does not contradict the requirement above. diff --git a/oteps/trace/4673-experimental-probability-sampling.md b/oteps/trace/4673-experimental-probability-sampling.md index f4b33f1d2e8..07d5d483e6f 100644 --- a/oteps/trace/4673-experimental-probability-sampling.md +++ b/oteps/trace/4673-experimental-probability-sampling.md @@ -471,7 +471,7 @@ each OpenTelemetry SDK. The `ConsistentProbabilityBased` Sampler MUST set `r` when it makes a root sampling decision. -##### Requirement: ConsistentProbabilityBased sampler unsets p when not sampled +##### Requirement: ConsistentProbabilityBased sampler un-sets p when not sampled The `ConsistentProbabilityBased` Sampler MUST unset `p` from the `tracestate` when it decides not to sample. diff --git a/package.json b/package.json index 761d59e8e8d..81c3f023fcd 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,7 @@ { "devDependencies": { + "@cspell/dict-people-names": "1.1.16", + "cspell": "9.6.3", "markdown-link-check": "3.14.2", "markdown-toc": "1.2.0", "markdownlint-cli": "0.47.0" diff --git a/specification/logs/data-model-appendix.md b/specification/logs/data-model-appendix.md index fd6c9658bbc..0edc9f146c7 100644 --- a/specification/logs/data-model-appendix.md +++ b/specification/logs/data-model-appendix.md @@ -82,7 +82,7 @@ this data model. MSGID string - Defines the type of the event. Part of event source identity. Example: "TCPIN" + Defines the type of the event. Part of event source identity. Example: `"TCPIN"` `Attributes["syslog.msgid"]` From 31ab2c7f9e4646b1450b43e25463a2477aa4a967 Mon Sep 17 00:00:00 2001 From: James Thompson Date: Thu, 5 Mar 2026 01:16:40 +1100 Subject: [PATCH 2/2] fix spelling issues --- specification/metrics/data-model.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/metrics/data-model.md b/specification/metrics/data-model.md index 7e65b14d33e..e1c83bc3363 100644 --- a/specification/metrics/data-model.md +++ b/specification/metrics/data-model.md @@ -455,7 +455,7 @@ in OTLP represents a sampled value at a given time. A Gauge stream consists of: - (optional) A timestamp (`start_time_unix_nano`) which best represents the first possible moment a measurement for this timeseries could have been recorded. - - (optional) a set of examplars (see [Exemplars](#exemplars)). + - (optional) a set of exemplars (see [Exemplars](#exemplars)). - (optional) Data point flags (see [Data point flags](#data-point-flags)). In OTLP, a point within a Gauge stream represents the last-sampled event for a @@ -1089,7 +1089,7 @@ Every OTLP metric data point has two associated timestamps. The first, mandatory timestamp is the one associated with the observation, the moment when the measurement became current or took effect, and is referred to as `TimeUnixNano`. The second, optional timestamp is used -to indicate when a sequence of points is unbroken and to inidcate when a +to indicate when a sequence of points is unbroken and to indicate when a timeseries began accumulating measurements. The second timestamp is referred to as `StartTimeUnixNano`.