diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml new file mode 100644 index 000000000000..46cfb2cc897b --- /dev/null +++ b/.github/workflows/check-spelling.yml @@ -0,0 +1,16 @@ +name: Check spelling + +on: + pull_request: + +jobs: + main: + name: Check spelling + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: streetsidesoftware/cspell-action@v2 + with: + files: | + content/**/* + config: .vscode/cspell.json diff --git a/.github/workflows/check-text.yml b/.github/workflows/check-text.yml new file mode 100644 index 000000000000..071d029155e5 --- /dev/null +++ b/.github/workflows/check-text.yml @@ -0,0 +1,16 @@ +name: Check text linter rules # cSpell:ignore refcache startswith + +on: + pull_request: + +jobs: + check-formatting: + name: Check text linter rules + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Make sure that we only install the dependencies for textlint to speed up install + - run: | + jq 'del(.dependencies) | .devDependencies |= with_entries( select(.key | startswith("textlint")))' package.json > package2.json && mv package2.json package.json + - run: npm install --ignore-scripts + - run: npm run check:text diff --git a/.vscode/cspell.json b/.vscode/cspell.json index a2fb36399cfb..9853a8d24763 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -5,7 +5,7 @@ "ignorePaths": ["*.svg"], // words here are only listed for their spelling, if there is a certain way // to write a word (e.g. OpenTelemetry vs Opentelemetry or cloud native vs - // cloud-native), edit the text-lint rules in package.json + // cloud-native), edit the text-lint rules in .textlintrc.json "words": [ "APAC", "Alolita", diff --git a/package.json b/package.json index a30964444dd0..67f82d24fc92 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "_check:links": "HTMLTEST_ARGS='--log-level 1' npm run __check:links", "_check:links:internal": "npm run __check:links", "_check:links--warn": "npm run _check:links || (echo; echo 'WARNING: see link-checker output for issues.'; echo)", - "_check:spelling": "npx cspell -c .vscode/cspell.json content data", - "_check:text": "npx textlint content data", + "_check:spelling": "npx cspell --no-progress -c .vscode/cspell.json content", + "_check:text": "npx textlint content", "_get:no": "echo SKIPPING get operation", "_get:submodule:non-lang": "npm run _get:submodule -- content-modules/opentelemetry-specification themes/docsy", "_get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 1}", @@ -32,6 +32,8 @@ "check:format": "npm run _check:format || (echo '[help] Run: npm run format'; exit 1)", "check:links": "npm run _check:links", "check:links:internal": "npm run _check:links:internal", + "check:spelling": "npm run _check:spelling", + "check:text": "npm run _check:text", "clean": "make clean", "cp:spec": "./scripts/content-modules/cp-pages.sh", "diff:check": "git diff --name-only --exit-code || (echo; echo 'WARNING: the files above have not been committed'; echo)",