diff --git a/.github/workflows/markdown-lint.yaml b/.github/workflows/markdown-lint.yaml index 70ce029166..2bd03ffe49 100644 --- a/.github/workflows/markdown-lint.yaml +++ b/.github/workflows/markdown-lint.yaml @@ -7,15 +7,19 @@ on: pull_request: paths: - '**.md' + - 'book/**' jobs: - markdown-link: + markdown-lint: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - name: Lint run: make markdown-lint + - name: Spell check + run: pip install codespell && make -C book codespell + - id: setup-chrome uses: browser-actions/setup-chrome@v2 with: @@ -29,13 +33,13 @@ jobs: fail_on_error: true filter_mode: nofilter - - name: Inform Slack users of link check failures + - name: Inform Slack users of check failures uses: tiloio/slack-webhook-action@v1.1.2 if: failure() && github.ref_name == 'main' with: slack_web_hook_url: ${{ secrets.SLACK_WEBHOOK_BRIMLABS_DOCS }} slack_json: | { - "username": "markdown-link", - "text": "Markdown link check failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + "username": "markdown-lint", + "text": "Markdown lint check failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" } diff --git a/Makefile b/Makefile index 6367d44e61..95142f7981 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,7 @@ markdown-lint: # CI performs these actions individually since that looks nicer in the UI; # this is a shortcut so that a local dev can easily run everything. test-ci: fmt tidy vet test-generate test-unit test-system test-heavy + $(MAKE) -C book codespell clean: @rm -rf dist diff --git a/book/Makefile b/book/Makefile index e1761806cd..256d5d738d 100644 --- a/book/Makefile +++ b/book/Makefile @@ -14,3 +14,7 @@ node_modules: vet: GOOS=js GOARCH=wasm go vet super-example/main.go + +.PHONY: codespell +codespell: + git ls-files -c -o --exclude-standard | xargs codespell -S src/tutorials/prs.json diff --git a/book/README.md b/book/README.md index 1f189cf700..50a643d4bc 100644 --- a/book/README.md +++ b/book/README.md @@ -32,6 +32,17 @@ After editing any JavaScript or Go files run `make` in this directory. This will update the Wasm file so playground examples use a version of SuperDB built from Go source files in the local repository. +The docs are spell checked with [codespell](https://github.com/codespell-project/codespell). +Install it with Homebrew: +```sh +brew install codespell +``` +then check your work with +```sh +make codespell +``` +This also runs as part of `make test-ci` and in CI. + ## Conventions The following is an evolving set of style conventions we've adopted when