forked from client9/misspell
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
66 lines (52 loc) · 1.88 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
CONTAINER=golangci/misspell
default: lint test build
install: ## install misspell into GOPATH/bin
go install ./cmd/misspell
build: ## build misspell
go build ./cmd/misspell
test: ## run all tests
CGO_ENABLED=1 go test -v -race .
lint: ## run linter
golangci-lint run
# the grep in line 2 is to remove misspellings in the spelling dictionary
# that trigger false positives!!
falsepositives: /scowl-wl
cat /scowl-wl/words-US-60.txt | \
grep -i -v -E "payed|Tyre|Euclidian|nonoccurence|dependancy|reenforced|accidently|surprize|dependance|idealogy|binominal|causalities|conquerer|withing|casette|analyse|analogue|dialogue|paralyse|catalogue|archaeolog|clarinettist|catalyses|cancell|chisell|ageing|cataloguing" | \
misspell -debug -error
cat /scowl-wl/words-GB-ise-60.txt | \
grep -v -E "payed|nonoccurence|withing" | \
misspell -locale=UK -debug -error
# cat /scowl-wl/words-GB-ize-60.txt | \
# grep -v -E "withing" | \
# misspell -debug -error
# cat /scowl-wl/words-CA-60.txt | \
# grep -v -E "withing" | \
# misspell -debug -error
bench: ## run benchmarks
go test -bench '.*'
clean: ## clean up time
rm -rf dist/ bin/
go clean ./...
git gc --aggressive
ci: docker-build ## run test like travis-ci does, requires docker
docker run --rm \
-v $(PWD):/go/src/github.com/golangci/misspell \
-w /go/src/github.com/golangci/misspell \
${CONTAINER} \
make install falsepositives
docker-build: ## build a docker test image
docker build -t ${CONTAINER} .
docker-console: ## log into the test image
docker run --rm -it \
-v $(PWD):/go/src/github.com/golangci/misspell \
-w /go/src/github.com/golangci/misspell \
${CONTAINER} sh
.PHONY: help ci console docker-build bench
# https://www.client9.com/self-documenting-makefiles/
help:
@awk -F ':|##' '/^[^\t].+?:.*?##/ {\
printf "\033[36m%-30s\033[0m %s\n", $$1, $$NF \
}' $(MAKEFILE_LIST)
.DEFAULT_GOAL=default
.PHONY=help