Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. CONTAINER=nickg/misspell
  2. install: ## install misspell into GOPATH/bin
  3. go install ./cmd/misspell
  4. build: hooks ## build and lint misspell
  5. ./scripts/build.sh
  6. test: ## run all tests
  7. go test .
  8. # real publishing is done only by travis
  9. publish: ## test goreleaser
  10. ./scripts/goreleaser-dryrun.sh
  11. # the grep in line 2 is to remove misspellings in the spelling dictionary
  12. # that trigger false positives!!
  13. falsepositives: /scowl-wl
  14. cat /scowl-wl/words-US-60.txt | \
  15. 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" | \
  16. misspell -debug -error
  17. cat /scowl-wl/words-GB-ise-60.txt | \
  18. grep -v -E "payed|nonoccurence|withing" | \
  19. misspell -locale=UK -debug -error
  20. # cat /scowl-wl/words-GB-ize-60.txt | \
  21. # grep -v -E "withing" | \
  22. # misspell -debug -error
  23. # cat /scowl-wl/words-CA-60.txt | \
  24. # grep -v -E "withing" | \
  25. # misspell -debug -error
  26. bench: ## run benchmarks
  27. go test -bench '.*'
  28. clean: ## clean up time
  29. rm -rf dist/ bin/
  30. go clean ./...
  31. git gc --aggressive
  32. ci: ## run test like travis-ci does, requires docker
  33. docker run --rm \
  34. -v $(PWD):/go/src/github.com/client9/misspell \
  35. -w /go/src/github.com/client9/misspell \
  36. ${CONTAINER} \
  37. make build falsepositives
  38. docker-build: ## build a docker test image
  39. docker build -t ${CONTAINER} .
  40. docker-pull: ## pull latest test image
  41. docker pull ${CONTAINER}
  42. docker-console: ## log into the test image
  43. docker run --rm -it \
  44. -v $(PWD):/go/src/github.com/client9/misspell \
  45. -w /go/src/github.com/client9/misspell \
  46. ${CONTAINER} sh
  47. .git/hooks/pre-commit: scripts/pre-commit.sh
  48. cp -f scripts/pre-commit.sh .git/hooks/pre-commit
  49. .git/hooks/commit-msg: scripts/commit-msg.sh
  50. cp -f scripts/commit-msg.sh .git/hooks/commit-msg
  51. hooks: .git/hooks/pre-commit .git/hooks/commit-msg ## install git precommit hooks
  52. .PHONY: help ci console docker-build bench
  53. # https://www.client9.com/self-documenting-makefiles/
  54. help:
  55. @awk -F ':|##' '/^[^\t].+?:.*?##/ {\
  56. printf "\033[36m%-30s\033[0m %s\n", $$1, $$NF \
  57. }' $(MAKEFILE_LIST)
  58. .DEFAULT_GOAL=help
  59. .PHONY=help