Files
my-pal-mcp-server/code_quality_checks.sh
Beehive Innovations c960bcb720 Add DocGen tool with comprehensive documentation generation capabilities (#109)
* WIP: new workflow architecture

* WIP: further improvements and cleanup

* WIP: cleanup and docks, replace old tool with new

* WIP: cleanup and docks, replace old tool with new

* WIP: new planner implementation using workflow

* WIP: precommit tool working as a workflow instead of a basic tool
Support for passing False to use_assistant_model to skip external models completely and use Claude only

* WIP: precommit workflow version swapped with old

* WIP: codereview

* WIP: replaced codereview

* WIP: replaced codereview

* WIP: replaced refactor

* WIP: workflow for thinkdeep

* WIP: ensure files get embedded correctly

* WIP: thinkdeep replaced with workflow version

* WIP: improved messaging when an external model's response is received

* WIP: analyze tool swapped

* WIP: updated tests
* Extract only the content when building history
* Use "relevant_files" for workflow tools only

* WIP: updated tests
* Extract only the content when building history
* Use "relevant_files" for workflow tools only

* WIP: fixed get_completion_next_steps_message missing param

* Fixed tests
Request for files consistently

* Fixed tests
Request for files consistently

* Fixed tests

* New testgen workflow tool
Updated docs

* Swap testgen workflow

* Fix CI test failures by excluding API-dependent tests

- Update GitHub Actions workflow to exclude simulation tests that require API keys
- Fix collaboration tests to properly mock workflow tool expert analysis calls
- Update test assertions to handle new workflow tool response format
- Ensure unit tests run without external API dependencies in CI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* WIP - Update tests to match new tools

* WIP - Update tests to match new tools

* WIP - Update tests to match new tools

* Should help with https://github.com/BeehiveInnovations/zen-mcp-server/issues/97
Clear python cache when running script: https://github.com/BeehiveInnovations/zen-mcp-server/issues/96
Improved retry error logging
Cleanup

* WIP - chat tool using new architecture and improved code sharing

* Removed todo

* Removed todo

* Cleanup old name

* Tweak wordings

* Tweak wordings
Migrate old tests

* Support for Flash 2.0 and Flash Lite 2.0

* Support for Flash 2.0 and Flash Lite 2.0

* Support for Flash 2.0 and Flash Lite 2.0
Fixed test

* Improved consensus to use the workflow base class

* Improved consensus to use the workflow base class

* Allow images

* Allow images

* Replaced old consensus tool

* Cleanup tests

* Tests for prompt size

* New tool: docgen
Tests for prompt size
Fixes: https://github.com/BeehiveInnovations/zen-mcp-server/issues/107
Use available token size limits: https://github.com/BeehiveInnovations/zen-mcp-server/issues/105

* Improved docgen prompt
Exclude TestGen from pytest inclusion

* Updated errors

* Lint

* DocGen instructed not to fix bugs, surface them and stick to d

* WIP

* Stop claude from being lazy and only documenting a small handful

* More style rules

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-22 10:21:19 +04:00

103 lines
3.0 KiB
Bash
Executable File

#!/bin/bash
# Zen MCP Server - Code Quality Checks
# This script runs all required linting and testing checks before committing changes.
# ALL checks must pass 100% for CI/CD to succeed.
set -e # Exit on any error
echo "🔍 Running Code Quality Checks for Zen MCP Server"
echo "================================================="
# Determine Python command
if [[ -f ".zen_venv/bin/python" ]]; then
PYTHON_CMD=".zen_venv/bin/python"
PIP_CMD=".zen_venv/bin/pip"
echo "✅ Using venv"
elif [[ -n "$VIRTUAL_ENV" ]]; then
PYTHON_CMD="python"
PIP_CMD="pip"
echo "✅ Using activated virtual environment: $VIRTUAL_ENV"
else
echo "❌ No virtual environment found!"
echo "Please run: ./run-server.sh first to set up the environment"
exit 1
fi
echo ""
# Check and install dev dependencies if needed
echo "🔍 Checking development dependencies..."
DEV_DEPS_NEEDED=false
# Check each dev dependency
for tool in ruff black isort pytest; do
# Check if tool exists in venv or in PATH
if [[ -f ".zen_venv/bin/$tool" ]] || command -v $tool &> /dev/null; then
continue
else
DEV_DEPS_NEEDED=true
break
fi
done
if [ "$DEV_DEPS_NEEDED" = true ]; then
echo "📦 Installing development dependencies..."
$PIP_CMD install -q -r requirements-dev.txt
echo "✅ Development dependencies installed"
else
echo "✅ Development dependencies already installed"
fi
# Set tool paths
if [[ -f ".zen_venv/bin/ruff" ]]; then
RUFF=".zen_venv/bin/ruff"
BLACK=".zen_venv/bin/black"
ISORT=".zen_venv/bin/isort"
PYTEST=".zen_venv/bin/pytest"
else
RUFF="ruff"
BLACK="black"
ISORT="isort"
PYTEST="pytest"
fi
echo ""
# Step 1: Linting and Formatting
echo "📋 Step 1: Running Linting and Formatting Checks"
echo "--------------------------------------------------"
echo "🔧 Running ruff linting with auto-fix..."
$RUFF check --fix --exclude test_simulation_files
echo "🎨 Running black code formatting..."
$BLACK . --exclude="test_simulation_files/"
echo "📦 Running import sorting with isort..."
$ISORT . --skip-glob=".zen_venv/*" --skip-glob="test_simulation_files/*"
echo "✅ Verifying all linting passes..."
$RUFF check --exclude test_simulation_files
echo "✅ Step 1 Complete: All linting and formatting checks passed!"
echo ""
# Step 2: Unit Tests
echo "🧪 Step 2: Running Complete Unit Test Suite"
echo "---------------------------------------------"
echo "🏃 Running unit tests (excluding integration tests)..."
$PYTHON_CMD -m pytest tests/ -v -x -m "not integration"
echo "✅ Step 2 Complete: All unit tests passed!"
echo ""
# Step 3: Final Summary
echo "🎉 All Code Quality Checks Passed!"
echo "=================================="
echo "✅ Linting (ruff): PASSED"
echo "✅ Formatting (black): PASSED"
echo "✅ Import sorting (isort): PASSED"
echo "✅ Unit tests: PASSED"
echo ""
echo "🚀 Your code is ready for commit and GitHub Actions!"
echo "💡 Remember to add simulator tests if you modified tools"