feat(docs, ci, config): add comprehensive documentation and tooling

- [x] Add API reference documentation with tool descriptions and examples
- [x] Add ERROR_CODES reference with error descriptions and remediation steps
- [x] Add PERFORMANCE tuning guide with caching and optimization details
- [x] Add GitHub Actions workflows for linting and security scanning
- [x] Add golangci-lint configuration with comprehensive linter settings
- [x] Add pre-commit hooks configuration for local development
- [x] Add API documentation generator tool (cmd/docgen)
- [x] Update Go version from 1.24 to 1.25 across workflows
- [x] Add static build configuration to goreleaser
- [x] Add metrics package with Prometheus-style metric types
- [x] Add parser benchmarks for performance testing
- [x] Add LSP manager integration tests
- [x] Add server integration tests with MCP protocol flow testing
- [x] Extract regex cache to shared utility package
- [x] Add context cancellation handling in AST queries
- [x] Add graceful shutdown with timeout to server
- [x] Add configurable max parse size (MaxParseSize)
- [x] Add Config.Validate() method with comprehensive checks
- [x] Add parser cache statistics tracking
- [x] Add file permission preservation in edit operations
- [x] Improve line splitting for large files with bufio.Scanner
- [x] Add comprehensive config tests for edge cases
- [x] Update Makefile with new targets and documentation
This commit is contained in:
2026-01-28 20:43:20 +00:00
parent 143a166249
commit 9205b2bc26
27 changed files with 6332 additions and 1634 deletions
+28 -3
View File
@@ -1,5 +1,4 @@
.PHONY: build test lint clean install run deps
.PHONY: build test lint clean install run deps docs
# Binary name
BINARY_NAME=mcp-filepuff
# Build directory
@@ -42,12 +41,29 @@ build-all:
# Run tests
test:
$(GOTEST) -v -race -coverprofile=coverage.out ./...
$(GOTEST) -v -coverprofile=coverage.out ./...
# Run tests with race detector on critical packages
test-race:
@echo "Running race detector tests on critical packages..."
$(GOTEST) -v -race -timeout=5m ./internal/edit/...
$(GOTEST) -v -race -timeout=5m ./internal/lsp/...
$(GOTEST) -v -race -timeout=5m ./internal/parser/...
$(GOTEST) -v -race -timeout=5m ./internal/server/...
@echo "Race detector tests completed successfully"
# Run tests with short flag
test-short:
$(GOTEST) -v -short ./...
# Run all tests including race detector
test-all: test test-race
# Run linters
lint:
@which golangci-lint > /dev/null || (echo "Installing golangci-lint..." && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest)
golangci-lint run ./...
# Clean build artifacts
clean:
rm -rf $(BUILD_DIR)
@@ -72,9 +88,18 @@ help:
@echo " build - Build the binary"
@echo " build-all - Build for all platforms"
@echo " test - Run tests with coverage"
@echo " test-race - Run tests with race detector on critical packages"
@echo " test-all - Run all tests including race detector"
@echo " test-short - Run short tests"
@echo " lint - Run linters"
@echo " clean - Clean build artifacts"
@echo " install - Install binary to GOPATH/bin"
@echo " run - Build and run the server"
@echo " run-workspace - Run with specific workspace (WORKSPACE=/path)"
# Generate API documentation
docs:
@echo "Generating API documentation..."
$(GOCMD) run ./cmd/docgen
@echo "Documentation generated in docs/API.md"