Skip to content

Commit

Permalink
Merge pull request #3630 from nawazkh/fix_codespell_err
Browse files Browse the repository at this point in the history
add makefile targets to install codespell and verify using codespell
  • Loading branch information
k8s-ci-robot authored Jul 17, 2023
2 parents 6b96d7f + 782f15d commit b7a0d41
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/codespell.yml

This file was deleted.

20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ KIND_VER := v0.20.0
KIND_BIN := kind
KIND := $(TOOLS_BIN_DIR)/$(KIND_BIN)-$(KIND_VER)

CODESPELL_VER := 2.2.5
CODESPELL_BIN := codespell
CODESPELL_DIST_DIR := codespell_dist
CODESPELL := $(TOOLS_BIN_DIR)/$(CODESPELL_DIST_DIR)/$(CODESPELL_BIN)

SETUP_ENVTEST_VER := v0.0.0-20211110210527-619e6b92dab9
SETUP_ENVTEST_BIN := setup-envtest
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
Expand Down Expand Up @@ -238,7 +243,7 @@ format-tiltfile: ## Format the Tiltfile.
./hack/verify-starlark.sh fix

.PHONY: verify
verify: verify-boilerplate verify-modules verify-gen verify-shellcheck verify-conversions verify-tiltfile ## Run "verify-boilerplate", "verify-modules", "verify-gen", "verify-shellcheck", "verify-conversions", "verify-tiltfile" rules.
verify: verify-boilerplate verify-modules verify-gen verify-shellcheck verify-conversions verify-tiltfile verify-codespell ## Run "verify-boilerplate", "verify-modules", "verify-gen", "verify-shellcheck", "verify-conversions", "verify-tiltfile" "verify-codespell" rules.

.PHONY: verify-boilerplate
verify-boilerplate: ## Verify boilerplate header.
Expand Down Expand Up @@ -268,6 +273,10 @@ verify-conversions: $(CONVERSION_VERIFIER) ## Verifies expected API conversion
verify-tiltfile: ## Verify Tiltfile format.
./hack/verify-starlark.sh

.PHONY: verify-codespell
verify-codespell: codespell ## Verify codespell.
@$(CODESPELL) $(ROOT_DIR) --ignore-words=$(ROOT_DIR)/.codespellignore --skip="*.git,*_artifacts,*.sum,$(ROOT_DIR)/hack/tools/bin/codespell_dist"

## --------------------------------------
## Development
## --------------------------------------
Expand Down Expand Up @@ -770,6 +779,7 @@ helm: $(HELM) ## Build a local copy of helm.
yq: $(YQ) ## Build a local copy of yq.
kind: $(KIND) ## Build a local copy of kind.
setup-envtest: $(SETUP_ENVTEST) ## Build a local copy of setup-envtest.
codespell : $(CODESPELL) ## Build a local copy of codespell.

$(CONVERSION_VERIFIER): go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $@ sigs.k8s.io/cluster-api/hack/tools/conversion-verifier
Expand Down Expand Up @@ -849,3 +859,11 @@ $(SETUP_ENVTEST_BIN): $(SETUP_ENVTEST) ## Build a local copy of setup-envtest.

$(SETUP_ENVTEST): # Build setup-envtest from tools folder.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(SETUP_ENVTEST_PKG) $(SETUP_ENVTEST_BIN) $(SETUP_ENVTEST_VER)

$(CODESPELL): ## Build codespell from tools folder.
@which $(CODESPELL) >/dev/null || ( \
mkdir -p $(TOOLS_BIN_DIR); \
pip install --target=$(TOOLS_BIN_DIR)/$(CODESPELL_DIST_DIR) $(CODESPELL_BIN)==$(CODESPELL_VER); \
mv $(TOOLS_BIN_DIR)/$(CODESPELL_DIST_DIR)/bin/$(CODESPELL_BIN) $(TOOLS_BIN_DIR)/$(CODESPELL_DIST_DIR); \
rm -r $(TOOLS_BIN_DIR)/$(CODESPELL_DIST_DIR)/bin; \
)
7 changes: 5 additions & 2 deletions docs/book/src/developers/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@
- [install instructions](https://kubectl.docs.kubernetes.io/installation/kustomize/) on Windows + WSL2.
- [install instructions][kustomizelinux] on Linux.
6. Install Python 3.x or 2.7.x, if neither is already installed.
7. Install make.
7. Install pip
- [pip installation instruction](https://pip.pypa.io/en/stable/installation/#installation)
8. Install make.
- `brew install make` on MacOS.
- `sudo apt install make` on Windows + WSL2.
- `sudo apt install make` on Linux.
8. Install [timeout][timeout]
9. Install [timeout][timeout]
- `brew install coreutils` on macOS.
9. Install [pre-commit framework](https://pre-commit.com/#installation)
- `brew install pre-commit` Or `pip install pre-commit`. Installs pre-commit globally.
Expand Down Expand Up @@ -462,6 +464,7 @@ If you're interested in submitting PRs to the project, please be sure to run som
```bash
make lint # Runs a suite of quick scripts to check code structure
make lint-fix # Runs a suite of quick scripts to fix lint errors
make verify # Runs a suite of verifying binaries
make test # Runs tests on the Go code
```

Expand Down

0 comments on commit b7a0d41

Please sign in to comment.