From c1ed0e2fd947445bd15b6a3d58908849b3c03788 Mon Sep 17 00:00:00 2001 From: Mustafa GUNES Date: Wed, 26 Mar 2025 10:41:31 +0300 Subject: [PATCH 1/4] add check_go.sh file for all o --- scripts/check_go.sh | 60 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 scripts/check_go.sh diff --git a/scripts/check_go.sh b/scripts/check_go.sh new file mode 100644 index 0000000..3ad1c4b --- /dev/null +++ b/scripts/check_go.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +check_go() { + if ! command -v go &> /dev/null; then + printf "Go is not installed on your system.\n" + read -p "Would you like to install Go now? (y/n): " choice + + case "$choice" in + y|Y) + printf "Installing Go...\n" + + # Detect OS + case "$(uname -s)" in + Darwin) + if command -v brew &> /dev/null; then + brew install go + else + printf "Homebrew not found. Please install Go manually from https://golang.org/dl/\n" + exit 1 + fi + ;; + Linux) + if command -v apt-get &> /dev/null; then + sudo apt-get update && sudo apt-get install -y golang-go + elif command -v yum &> /dev/null; then + sudo yum install -y golang + else + printf "Package manager not found. Please install Go manually from https://golang.org/dl/\n" + exit 1 + fi + ;; + MINGW*|MSYS*|CYGWIN*) + printf "On Windows, please install Go manually from https://golang.org/dl/\n" + exit 1 + ;; + *) + printf "Unsupported operating system. Please install Go manually from https://golang.org/dl/\n" + exit 1 + ;; + esac + + # Verify installation + if ! command -v go &> /dev/null; then + printf "Go installation failed.\n" + exit 1 + fi + printf "Go has been installed successfully!\n" + ;; + *) + printf "Go installation skipped. Please install Go before building.\n" + exit 1 + ;; + esac + else + printf "Go is already installed. Version: %s\n" "$(go version)" + return 0 + fi +} + +check_go \ No newline at end of file From 6ce34eee2b0da4067dd2b3056dad4040bfc01b6c Mon Sep 17 00:00:00 2001 From: Mustafa GUNES Date: Wed, 26 Mar 2025 10:42:02 +0300 Subject: [PATCH 2/4] update makefile flow - colorize steps --- Makefile | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4005032..391cb1b 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,39 @@ +# Color definitions +BLUE=\033[0;34m +GREEN=\033[0;32m +YELLOW=\033[0;33m +RED=\033[0;31m +NC=\033[0m # No Color + BINARY_NAME=mcp VERSION=$(shell git describe --tags --always --dirty 2>/dev/null || echo "dev") BUILD_TIME=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") LDFLAGS=-ldflags "-X main.Version=$(VERSION) -X main.BuildTime=$(BUILD_TIME)" -.PHONY: build clean install test +# Default Makefile step +default: setup + @echo "$(GREEN)All setup steps completed successfully!$(NC)" + +# Setup for Cocoapods +setup: \ + check-go \ + build \ + clean \ + install \ + test + @echo "$(GREEN)Setup process completed$(NC)" + +check-go: + @echo "$(BLUE)Checking Go installation and version...$(NC)" + chmod +x ./scripts/check_go.sh + ./scripts/check_go.sh build: + @echo "$(YELLOW)Building $(BINARY_NAME)...$(NC)" go build $(LDFLAGS) -o bin/$(BINARY_NAME) ./cmd/mcptools build-all: clean + @echo "$(YELLOW)Building all platform binaries...$(NC)" GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)_darwin_amd64 ./cmd/mcptools GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)_darwin_arm64 ./cmd/mcptools GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)_linux_amd64 ./cmd/mcptools @@ -16,13 +41,17 @@ build-all: clean GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)_windows_amd64.exe ./cmd/mcptools install: + @echo "$(BLUE)Installing $(BINARY_NAME)...$(NC)" go install $(LDFLAGS) ./cmd/mcptools clean: - rm -rf bin/ + @echo "$(RED)Cleaning build artifacts...$(NC)" + -test: +test: check-go + @echo "$(YELLOW)Running tests...$(NC)" go test -v ./... -lint: - golangci-lint run ./... \ No newline at end of file +lint: check_go + @echo "$(BLUE)Running linter...$(NC)" + golangci-lint run ./... \ No newline at end of file From 649ec714bfadaf6631d8460bdadd9c6c2acaab8b Mon Sep 17 00:00:00 2001 From: Mustafa GUNES Date: Wed, 26 Mar 2025 10:42:36 +0300 Subject: [PATCH 3/4] add contributing.md --- CONTRIBUTING.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c0da04e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,46 @@ +# Contributing to MCPTools + +Thank you for considering contributing to MCPTools! This document provides guidelines and instructions for contributing to the project. + +## Getting Started + +1. Fork the repository +2. Clone your fork: `git clone https://github.com/YOUR-USERNAME/mcptools.git` +3. Create a new branch: `git checkout -b feature/your-feature-name` + +## Development Setup + +1. No need to pre-install Go - the setup process will automatically install it if needed +2. Run `make setup` to set up the development environment (this will check/install Go and set up everything else) +3. Make your changes +4. Run tests using `make test` +5. Run the linter using `make lint` + +## Pull Request Process + +1. Update the README.md with details of changes if needed +2. Follow the existing code style and formatting +3. Add tests for new features +4. Ensure all tests pass and the linter shows no errors +5. Update documentation as needed + +## Commit Messages + +- Use clear and meaningful commit messages +- Start with a verb in present tense (e.g., "Add feature" not "Added feature") +- Reference issue numbers if applicable + +## Code Style + +- Follow Go best practices and idioms +- Use meaningful variable and function names +- Add comments for complex logic +- Keep functions focused and small + +## Questions or Problems? + +Feel free to open an issue for any questions or problems you encounter. + +## License + +By contributing, you agree that your contributions will be licensed under the same terms as the main project. \ No newline at end of file From c86e4efe53a4d390e8598b68502aafc2b90ebd0b Mon Sep 17 00:00:00 2001 From: Mustafa GUNES Date: Wed, 26 Mar 2025 10:45:56 +0300 Subject: [PATCH 4/4] update readme for contributing md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index d69fba1..c5cc160 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ This will open a shell as following: ![MCP Tools Screenshot](.github/resources/screenshot.png) +## Contributing + +We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details on how to submit pull requests, report issues, and contribute to the project. + ## Installation ### Using Homebrew