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)
31PWD := $(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
104PYTHON := $(shell command -v python3 2>/dev/null || command -v python 2>/dev/null)
115PIP := $(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
4533markdown-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
117100compliance-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"
0 commit comments