mirror of
https://github.com/lukaszraczylo/filepuff-mcp.git
synced 2026-06-05 22:23:50 +00:00
9205b2bc26
- [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
105 lines
3.1 KiB
Makefile
105 lines
3.1 KiB
Makefile
.PHONY: build test lint clean install run deps docs
|
|
# Binary name
|
|
BINARY_NAME=mcp-filepuff
|
|
# Build directory
|
|
BUILD_DIR=bin
|
|
# Main package
|
|
MAIN_PKG=./cmd/mcp-filepuff
|
|
|
|
# Go parameters
|
|
GOCMD=go
|
|
GOBUILD=$(GOCMD) build
|
|
GOTEST=$(GOCMD) test
|
|
GOGET=$(GOCMD) get
|
|
GOMOD=$(GOCMD) mod
|
|
GOFMT=$(GOCMD) fmt
|
|
|
|
# Build flags
|
|
LDFLAGS=-ldflags "-s -w" -buildvcs=false
|
|
|
|
# Default target
|
|
all: deps test build
|
|
|
|
# Install dependencies
|
|
deps:
|
|
$(GOMOD) download
|
|
$(GOMOD) tidy
|
|
|
|
# Build the binary
|
|
build:
|
|
mkdir -p $(BUILD_DIR)
|
|
$(GOBUILD) $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) $(MAIN_PKG)
|
|
|
|
# Build for all platforms
|
|
build-all:
|
|
mkdir -p $(BUILD_DIR)
|
|
GOOS=darwin GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 $(MAIN_PKG)
|
|
GOOS=darwin GOARCH=arm64 $(GOBUILD) $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 $(MAIN_PKG)
|
|
GOOS=linux GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 $(MAIN_PKG)
|
|
GOOS=linux GOARCH=arm64 $(GOBUILD) $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64 $(MAIN_PKG)
|
|
GOOS=windows GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe $(MAIN_PKG)
|
|
|
|
# Run tests
|
|
test:
|
|
$(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)
|
|
rm -f coverage.out
|
|
|
|
# Install binary to GOPATH/bin
|
|
install: build
|
|
cp $(BUILD_DIR)/$(BINARY_NAME) $(GOPATH)/bin/
|
|
|
|
# Run the server (for development)
|
|
run: build
|
|
./$(BUILD_DIR)/$(BINARY_NAME) -log-level debug
|
|
|
|
# Run with specific workspace
|
|
run-workspace: build
|
|
./$(BUILD_DIR)/$(BINARY_NAME) -workspace $(WORKSPACE) -log-level debug
|
|
|
|
# Show help
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " deps - Download and tidy dependencies"
|
|
@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"
|