Skip to content

Commit

Permalink
Introduce github workflows for cspell and textlint (#2971)
Browse files Browse the repository at this point in the history
Co-authored-by: Patrice Chalin <[email protected]>
  • Loading branch information
svrnm and chalin authored Jul 6, 2023
1 parent ce34928 commit c11aa76
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/check-spelling.yml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions .github/workflows/check-text.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand All @@ -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)",
Expand Down

0 comments on commit c11aa76

Please sign in to comment.