Skip to content

Commit 75c2ec7

Browse files
committed
Add typos tool setup: Added codespell configuration in Makefile.tools.mk
- fixed typos - added gitaction for typos Signed-off-by: Jooho Lee <jlee@redhat.com>
1 parent df524c5 commit 75c2ec7

File tree

6 files changed

+64
-5
lines changed

6 files changed

+64
-5
lines changed

.github/workflows/check-typos.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Check Typos
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
typos:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Check typos
16+
uses: crate-ci/typos@v1.34.0
17+

.typos.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[default.extend-words]
2+
k8s = "k8s"
3+
KServe = "KServe"
4+
vLLM = "vLLM"
5+
IST = "IST"
6+
7+
[files]
8+
extend-exclude = ["*.png", "*.jpg", "deploy/"]
9+

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# The Go and Python based tools are defined in Makefile.tools.mk.
2+
include Makefile.tools.mk
3+
14
SHELL := /usr/bin/env bash
25

36
# Defaults
@@ -70,7 +73,7 @@ post-deploy-test: ## Run post deployment tests
7073
@echo "Post-deployment tests passed."
7174

7275
.PHONY: lint
73-
lint: check-golangci-lint ## Run lint
76+
lint: check-golangci-lint check-typos ## Run lint
7477
@printf "\033[33;1m==== Running linting ====\033[0m\n"
7578
golangci-lint run
7679

@@ -200,6 +203,20 @@ env: ## Print environment variables
200203
@echo "IMG=$(IMG)"
201204
@echo "CONTAINER_TOOL=$(CONTAINER_TOOL)"
202205

206+
.PHONY: check-typos
207+
check-typos: $(TYPOS) ## Check for spelling errors using typos (exits with error if found)
208+
@echo "🔍 Checking for spelling errors with typos..."
209+
@TYPOS_OUTPUT=$$($(TYPOS) --format brief 2>&1); \
210+
if [ $$? -eq 0 ]; then \
211+
echo "✅ No spelling errors found!"; \
212+
echo "🎉 Spelling check completed successfully!"; \
213+
else \
214+
echo "❌ Spelling errors found!"; \
215+
echo "🔧 You can try 'make fix-typos' to automatically fix the spelling errors and run 'make check-typos' again"; \
216+
echo "$$TYPOS_OUTPUT"; \
217+
exit 1; \
218+
fi
219+
203220
##@ Tools
204221

205222
.PHONY: check-tools

Makefile.tools.mk

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
LOCALBIN ?= $(shell pwd)/bin
2+
$(LOCALBIN):
3+
[ -d $@ ] || mkdir -p $@
4+
5+
## Tool binary names.
6+
TYPOS = $(LOCALBIN)/typos
7+
8+
## Tool versions.
9+
TYPOS_VERSION ?= v1.34.0
10+
11+
.PHONY: typos
12+
typos: $(TYPOS)
13+
$(TYPOS): | $(LOCALBIN)
14+
@echo "Downloading typos $(TYPOS_VERSION)..."
15+
curl -L https://github.com/crate-ci/typos/releases/download/$(TYPOS_VERSION)/typos-$(TYPOS_VERSION)-x86_64-unknown-linux-musl.tar.gz | tar -xz -C $(LOCALBIN) --wildcards '*/typos'
16+
chmod +x $(TYPOS)

docs/architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ has the following form:
119119
- name: aName
120120
type: a-type
121121
parameters:
122-
parm1: val1
123-
parm2: val2
122+
param1: val1
123+
param2: val2
124124
```
125125
The fields in a plugin entry are:
126126
- **name** (optional): provides a name by which the plugin instance can be referenced. If this
@@ -210,7 +210,7 @@ Filters out pods using a standard Kubernetes label selector.
210210

211211
- **Type**: `by-label-selector`
212212
- **Parameters**: A standard Kubernetes label selector.
213-
- `matchLabels`: map of `{key,value}` pairs. If more than one pair are in the map, all of the keys are checked and the results are ANDed together.
213+
- `matchLabels`: map of `{key,value}` pairs. If more than one pair are in the map, all of the keys are checked and the results are combined with AND logic.
214214

215215
---
216216

docs/create_new_filter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (blf *ByLabels) Filter(_ *types.SchedulingContext, pods []types.Pod) []type
115115
```
116116

117117
Since the filter is only matching on candidate `types.Pod` labels,
118-
we leave the `types.SchedullingContext` parameter unnamed. Filters
118+
we leave the `types.SchedulingContext` parameter unnamed. Filters
119119
that need access to LLM request information (e.g., filtering based
120120
on prompt length) may use it.
121121

0 commit comments

Comments
 (0)