chore: initial release v0.1.0
ci / test (push) Failing after 5s
ci / lint (push) Failing after 4s

forge-toolkit: хелперы для разработки MCP-серверов на Go.

- toolkit: args/schema/result/env/probe/server
- toolkit/validate: валидаторы синтаксиса
- configreload: live-reload конфига по контент-хэшу
- docs: ARCHITECTURE, quickstart, mcp-contract
- template/ и examples/hello-tool/
- CI (Gitea Actions), лицензия Apache-2.0
This commit is contained in:
Maksim Totmin
2026-09-14 00:23:08 +07:00
commit c398045664
43 changed files with 2581 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
# forge-toolkit — сборка, тесты, линт.
GO ?= go
GOLANGCI_LINT ?= golangci-lint
.PHONY: test test-fast lint fmt tidy toolkit-deps ci
# Тесты с race-детектором (основной гейт).
test:
$(GO) test -race ./... -count=1
# Быстрая итерация без race.
test-fast:
$(GO) build ./... && $(GO) vet ./... && $(GO) test ./... -count=1
# Статический анализ + форматирование.
lint:
@command -v $(GOLANGCI_LINT) >/dev/null 2>&1 || { \
echo "golangci-lint не найден: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.2"; \
exit 1; }
$(GOLANGCI_LINT) run ./...
@unformatted=$$(gofmt -l .); \
if [ -n "$$unformatted" ]; then echo "gofmt: нужно форматирование: $$unformatted"; exit 1; fi
fmt:
gofmt -w .
tidy:
$(GO) mod tidy
# Карантин зависимостей: тулкит обязан оставаться stdlib + go-sdk
# (+ yaml/toml в validate). Любая другая ПРЯМАЯ зависимость — ошибка.
toolkit-deps:
@direct=$$($(GO) list -m -f '{{if not .Main}}{{if not .Indirect}}{{.Path}}{{end}}{{end}}' all); \
allowed='^(github.com/modelcontextprotocol/go-sdk|gopkg.in/yaml.v3|github.com/BurntSushi/toml)$$'; \
bad=$$(echo "$$direct" | grep -vE "$$allowed" | grep -v '^$$'); \
if [ -n "$$bad" ]; then \
echo "недопустимые прямые зависимости (разрешены только go-sdk/yaml/toml):"; \
echo "$$bad"; exit 1; \
fi; \
echo "toolkit-deps: ok"
ci: test lint toolkit-deps