Skip to content

Commit 49f2afe

Browse files
committed
Perform the tool switch to cspell
1 parent adbab30 commit 49f2afe

17 files changed

Lines changed: 140 additions & 83 deletions

.cspell.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# For settings, see
2+
# https://www.streetsidesoftware.com/vscode-spell-checker/docs/configuration/
3+
version: '0.2'
4+
language: en-US
5+
caseSensitive: true
6+
allowCompoundWords: true
7+
useGitignore: true
8+
import:
9+
- https://cdn.jsdelivr.net/npm/@cspell/dict-people-names/cspell-ext.json
10+
ignorePaths:
11+
- '**/*.svg'
12+
- '.*.yml'
13+
- '.*.yaml'
14+
- 'schemas/**'
15+
- 'spec-compliance-matrix/*.yaml'
16+
- 'oteps/assets/0225*.*'
17+
patterns:
18+
- name: CodeBlock
19+
pattern: |
20+
/
21+
^(\s*[~`]{3,}) # Matches 3 or more backticks or tildes to start a code block.
22+
.* # all languages and options, e.g. shell {hl_lines=[12]}
23+
[\s\S]*? # content
24+
\1 # Matches the same symbol which started the match.
25+
/igmx
26+
- name: CodeName
27+
pattern: |
28+
/
29+
([~`]) # Matches a single backtick or tilde to start a code block.
30+
[^~`]*? # Matches any characters except backticks or tildes, non-greedy.
31+
\1 # Matches the same symbol which started the match.
32+
/x
33+
- name: Links
34+
pattern: |
35+
/
36+
\[[^\]]+\] # Matches the link text inside square brackets [ ... ].
37+
\( # Match the opening parentheses for the URL.
38+
[^)]+ # Matches any URL/path until the closing ) — works for both relative and absolute.
39+
\) # Match the closing parentheses for the URL.
40+
/x
41+
- name: Redirect
42+
pattern: |
43+
/
44+
redirect:.+$ # Matches any front-matter redirect line.
45+
/mx
46+
languageSettings:
47+
- languageId:
48+
- markdown
49+
- yaml
50+
ignoreRegExpList:
51+
- CodeBlock
52+
- CodeName
53+
- Links
54+
- Redirect
55+
dictionaries:
56+
# Local word lists
57+
- en-words
58+
# Programming languages and software terms
59+
- cpp
60+
- csharp
61+
- dart
62+
- django
63+
- docker
64+
- dotnet
65+
- elixir
66+
- flutter
67+
- fsharp
68+
- golang
69+
- haskell
70+
- html
71+
- java
72+
- julia
73+
- k8s
74+
- kotlin
75+
- markdown
76+
- node
77+
- npm
78+
- php
79+
- python
80+
- ruby
81+
- rust
82+
- scala
83+
- softwareTerms
84+
- swift
85+
- typescript
86+
# Other
87+
- companies
88+
- aws
89+
- google
90+
- people-names
91+
words:
92+
- BLRP
93+
- Kubecon
94+
- OpAMP
95+
- OTCA
96+
- OTEP
97+
- OTTL
98+
- cumulatives
99+
- deser
100+
- inclusivity
101+
- oteps
102+
- representivity
103+
- relatedly
104+
- Naur
105+
- configurator
106+
- relitigating
107+
- IDCONTEXT
108+
- pdata
109+
- Dpanic

.github/workflows/checks.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,9 @@ jobs:
8585
- name: check out code
8686
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8787

88-
- name: run misspell
89-
run: make misspell
88+
- uses: streetsidesoftware/cspell-action@v8
89+
with:
90+
incremental_files_only: false # check all files, not just changed files
91+
config: .cspell.yaml
92+
suggestions: true
93+
treat_flagged_words_as_errors: true

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ bin
2222
# Vim
2323
.swp
2424

25-
# Misspell binary
26-
internal/tools/bin
27-
2825
# Node.js files for tools (e.g. markdown-toc)
2926
node_modules/
3027
package-lock.json

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"streetsidesoftware.code-spell-checker",
4+
"streetsidesoftware.code-spell-checker-cspell-bundled-dictionaries"
5+
]
6+
}

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"rewrap.wrappingColumn": 80,
33
"editor.rulers": [80],
4+
"cSpell.autoFormatConfigFile": true,
45
"markdownlint.config": {
56
"MD004": false,
67
"MD013": false,

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ release.
169169

170170
### Common
171171

172-
- OTLP Exporters may allow devs to prepend a product identifier in `User-Agent` header.
172+
- OTLP Exporters may allow developers to prepend a product identifier in `User-Agent` header.
173173
([#4560](https://github.com/open-telemetry/opentelemetry-specification/pull/4560))
174174
- ⚠️ **IMPORTANT**: Extending the set of standard attribute value types is no longer a breaking change.
175175
([#4614](https://github.com/open-telemetry/opentelemetry-specification/pull/4614))

CONTRIBUTING.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ checks directly.
104104
See:
105105

106106
- [MarkdownStyle](#markdown-style)
107-
- [Misspell Check](#misspell-check)
107+
- [CSpell Check](#cspell-check)
108108
- Markdown link checking (docs TODO)
109109

110110
### Autoformatting
@@ -120,7 +120,6 @@ You can also run these fixes individually.
120120

121121
See:
122122

123-
- [Misspell Correction](#misspell-check)
124123
- Table Generation (docs TODO)
125124

126125
### Markdown style
@@ -148,24 +147,14 @@ with the Node version of markdownlint. If you are using Visual Studio Code,
148147
you can also use the `fixAll` command of the
149148
[vscode markdownlint extension](https://github.com/DavidAnson/vscode-markdownlint).
150149

151-
### Misspell check
150+
### CSpell check
152151

153152
In addition, please make sure to clean up typos before you submit the change.
154153

155154
To check for typos, run the following command:
156155

157156
```bash
158-
make misspell
159-
```
160-
161-
> [!NOTE]
162-
> The `misspell` make target will also fetch and build the tool if
163-
> necessary. You'll need [Go](https://go.dev) to build the spellchecker.
164-
165-
To quickly fix typos, use
166-
167-
```bash
168-
make misspell-correction
157+
make cspell
169158
```
170159

171160
## Updating the Compliance Matrix

Makefile

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
# All documents to be used in spell check.
2-
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)
31
PWD := $(shell pwd)
42

5-
TOOLS_DIR := ./internal/tools
6-
MISSPELL_BINARY=bin/misspell
7-
MISSPELL = $(TOOLS_DIR)/$(MISSPELL_BINARY)
8-
93
# Detect Python and pip commands
104
PYTHON := $(shell command -v python3 2>/dev/null || command -v python 2>/dev/null)
115
PIP := $(shell command -v pip3 2>/dev/null || command -v pip 2>/dev/null)
@@ -28,18 +22,12 @@ SEMCONVGEN_VERSION=0.17.0
2822

2923
# TODO: add `yamllint` step to `all` after making sure it works on Mac.
3024
.PHONY: all
31-
all: install-tools markdownlint markdown-link-check misspell
32-
33-
$(MISSPELL):
34-
cd $(TOOLS_DIR) && go build -o $(MISSPELL_BINARY) github.com/client9/misspell/cmd/misspell
25+
all: install-tools markdownlint markdown-link-check cspell
3526

36-
.PHONY: misspell
37-
misspell: $(MISSPELL)
38-
$(MISSPELL) -error $(ALL_DOCS)
39-
40-
.PHONY: misspell-correction
41-
misspell-correction: $(MISSPELL)
42-
$(MISSPELL) -w $(ALL_DOCS)
27+
.PHONY: cspell
28+
cspell:
29+
@if ! npm ls cspell; then npm install; fi
30+
npx cspell . --no-progress
4331

4432
.PHONY: markdown-link-check
4533
markdown-link-check:
@@ -104,14 +92,9 @@ yamllint:
10492

10593
# Run all checks in order of speed / likely failure.
10694
.PHONY: check
107-
check: misspell markdownlint markdown-link-check
95+
check: cspell markdownlint markdown-link-check
10896
@echo "All checks complete"
10997

110-
# Attempt to fix issues / regenerate tables.
111-
.PHONY: fix
112-
fix: misspell-correction
113-
@echo "All autofixes complete"
114-
11598
# Generate spec compliance matrix from YAML source
11699
.PHONY: compliance-matrix
117100
compliance-matrix: check-python
@@ -120,6 +103,6 @@ compliance-matrix: check-python
120103
@echo "Compliance matrix generation complete"
121104

122105
.PHONY: install-tools
123-
install-tools: $(MISSPELL)
106+
install-tools:
124107
npm install
125108
@echo "All tools installed"

internal/tools/go.mod

Lines changed: 0 additions & 5 deletions
This file was deleted.

internal/tools/go.sum

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)