diff --git a/.github/workflows/spellcheck.yaml b/.github/workflows/spellcheck.yaml new file mode 100644 index 0000000000..ed87b1df14 --- /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,./scripts,MAINTAINERS,LICENSE,go.mod,go.sum --check-filenames --ignore-words-list=ba \ No newline at end of file diff --git a/pkg/secretsencrypt/config.go b/pkg/secretsencrypt/config.go index 775c292230..2fa31e47f0 100644 --- a/pkg/secretsencrypt/config.go +++ b/pkg/secretsencrypt/config.go @@ -118,7 +118,7 @@ func GenEncryptionConfigHash(runtime *config.ControlRuntime) (string, error) { return hex.EncodeToString(encryptionConfigHash[:]), nil } -// GenReencryptHash generates a sha256 hash fom the existing secrets keys and +// GenReencryptHash generates a sha256 hash from the existing secrets keys and // a new key based on the input arguments. func GenReencryptHash(runtime *config.ControlRuntime, keyName string) (string, error) { diff --git a/scripts/codespell.sh b/scripts/codespell.sh deleted file mode 100755 index 34576c311f..0000000000 --- a/scripts/codespell.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# Ignore vendor folder and check file names as well -# Note: ignore "ba" in https://github.com/k3s-io/k3s/blob/4317a91/scripts/provision/vagrant#L54 -codespell --skip=.git,./vendor,MAINTAINERS,go.mod,go.sum --check-filenames --ignore-words-list=ba - -code=$? -if [ $code -ne 0 ]; then - echo "Error: codespell found one or more problems!" - exit $code -fi diff --git a/scripts/test b/scripts/test index f7d49ff51b..6b5bc19881 100755 --- a/scripts/test +++ b/scripts/test @@ -2,7 +2,6 @@ set -e -x cd $(dirname $0)/.. -. ./scripts/codespell.sh . ./scripts/version.sh . ./scripts/test-helpers diff --git a/tests/TESTING.md b/tests/TESTING.md index 44ed70cf3d..a0239d5b0e 100644 --- a/tests/TESTING.md +++ b/tests/TESTING.md @@ -51,7 +51,7 @@ ___ ## Integration Tests -Integration tests should be used to test a specific functionality of k3s that exists across multiple Go packages, either via exported function calls, or more often, CLI comands. +Integration tests should be used to test a specific functionality of k3s that exists across multiple Go packages, either via exported function calls, or more often, CLI commands. Integration tests should be used for "black box" testing. See [integration/README.md](./integration/README.md) for more info. diff --git a/tests/e2e/testutils.go b/tests/e2e/testutils.go index 2980ecc343..89b517602f 100644 --- a/tests/e2e/testutils.go +++ b/tests/e2e/testutils.go @@ -81,7 +81,7 @@ func CreateCluster(nodeOS string, serverCount, agentCount int) ([]string, []stri // CreateLocalCluster creates a cluster using the locally built k3s binary. The vagrant-scp plugin must be installed for // this function to work. The binary is deployed as an airgapped install of k3s on the VMs. -// This is intended only for local testing puposes when writing a new E2E test. +// This is intended only for local testing purposes when writing a new E2E test. func CreateLocalCluster(nodeOS string, serverCount, agentCount int) ([]string, []string, error) { serverNodeNames, agentNodeNames, nodeEnvs := genNodeEnvs(nodeOS, serverCount, agentCount) diff --git a/tests/integration/README.md b/tests/integration/README.md index 54d89a0a02..d5c8051663 100644 --- a/tests/integration/README.md +++ b/tests/integration/README.md @@ -1,6 +1,6 @@ # Integration Tests -Integration tests should be used to test a specific functionality of k3s that exists across multiple Go packages, either via exported function calls, or more often, CLI comands. +Integration tests should be used to test a specific functionality of k3s that exists across multiple Go packages, either via exported function calls, or more often, CLI commands. Integration tests should be used for "black box" testing. ## Framework