diff --git a/.codespellignore b/.codespellignore index 48ce07037a..af0977a8e8 100644 --- a/.codespellignore +++ b/.codespellignore @@ -2,4 +2,5 @@ aks gcp gce ec2 -eks \ No newline at end of file +eks +ro diff --git a/.github/workflows/spellcheck.yaml b/.github/workflows/spellcheck.yaml new file mode 100644 index 0000000000..1d26a07675 --- /dev/null +++ b/.github/workflows/spellcheck.yaml @@ -0,0 +1,24 @@ +name: Codespell +on: + push: + pull_request: + branches: + - master + workflow_dispatch: {} +jobs: + spellcheck: + name: Spell Check + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Set up Python 🐍 + uses: actions/setup-python@v4 + - name: Install codespell + run: | + python -m pip install --upgrade pip + pip install codespell + - name: Check spelling + run: codespell --skip=.git,./vendor,./MAINTAINERS,go.mod,go.sum --check-filenames --ignore-regex=.te# --ignore-words=.codespellignore diff --git a/Makefile b/Makefile index f09994a3a4..50581a37c0 100644 --- a/Makefile +++ b/Makefile @@ -140,11 +140,7 @@ package-windows-bundle: build ## Package the Windows tarball bundle ./scripts/package-windows-bundle .PHONY: test -test: codespell-test unit-tests integration-tests - -.PHONY: codespell-test -codespell-test: - ./scripts/codespell.sh +test: unit-tests integration-tests .PHONY: unit-tests unit-tests: diff --git a/developer-docs/testing.md b/developer-docs/testing.md index e408a4d538..a6d9e0e6d7 100644 --- a/developer-docs/testing.md +++ b/developer-docs/testing.md @@ -53,7 +53,7 @@ ___ ## Integration Tests Integration tests should be used to test a specific functionality of RKE2 that exists across multiple Go packages, -either via exported function calls, or more often, CLI comands. Integration tests should be used for "black box" +either via exported function calls, or more often, CLI commands. Integration tests should be used for "black box" testing. ### Framework diff --git a/scripts/codespell.sh b/scripts/codespell.sh deleted file mode 100755 index e9fec4960d..0000000000 --- a/scripts/codespell.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -e - -# Ignore vendor folder and check file names as well -# Note: ignore ".te#" in https://github.com/rancher/rke2/blob/eb79cc8/docs/security/selinux.md#L13,L17-L19 -codespell --skip=.git,./vendor,./MAINTAINERS,go.mod,go.sum --check-filenames --ignore-regex=.te# --ignore-words=.codespellignore - -code=$? -if [ $code -ne 0 ]; then - echo "Error: codespell found one or more problems!" - exit $code -fi