Skip to content

Latest commit

 

History

History
198 lines (145 loc) · 4.3 KB

CONTRIBUTING.md

File metadata and controls

198 lines (145 loc) · 4.3 KB

Contributing Guide

Thank you for your interest in the ScriptMate project! We welcome all forms of contributions.

How to Contribute

Reporting Issues

If you find a bug or have a feature suggestion, please:

  1. Check Issues to ensure the issue hasn't been reported yet
  2. Create a new Issue including:
    • Clear title and description
    • Steps to reproduce (if it's a bug)
    • Expected behavior
    • Actual behavior
    • System environment information

Submitting Code

  1. Fork the Project

    git clone https://github.com/your-username/scriptmate.git
    cd scriptmate
  2. Set Up Development Environment

    # Install uv (if not already installed)
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Install dependencies
    uv sync --dev
    
    # Set up pre-commit hooks
    uv run pre-commit install
  3. Create Feature Branch

    git checkout -b feature/your-feature-name
  4. Develop and Test

    # Run tests
    make test
    
    # Code linting
    make lint
    
    # Code formatting
    make format
  5. Commit Changes

    git add .
    git commit -m "feat: add your feature description"
  6. Push and Create Pull Request

    git push origin feature/your-feature-name

Development Standards

Code Style

  • Use Black for code formatting
  • Use Flake8 for code linting
  • Use MyPy for type checking
  • Follow PEP 8 coding standards

Commit Messages

Use Conventional Commits format:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types include:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation update
  • style: Code formatting
  • refactor: Code refactoring
  • test: Test related
  • chore: Build process or auxiliary tool changes

Example:

feat(cli): add dry-run option for command generation

Add --dry-run flag to allow users to see generated commands
without executing them.

Closes #123

Testing

  • Write tests for new features
  • Ensure all tests pass
  • Maintain test coverage above 90%
# Run tests
uv run pytest

# View coverage
uv run pytest --cov=src/scriptmate --cov-report=html

Documentation

  • Update relevant documentation
  • Add usage examples for new features
  • Ensure README.md stays up to date

Project Structure

ScriptMate/
├── src/scriptmate/        # Main source code
│   ├── cli.py            # Command-line interface
│   ├── config.py         # Configuration management
│   ├── llm_client.py     # Large language model client
│   ├── executor.py       # Command executor
│   └── utils.py          # Utility functions
├── tests/                # Test files
├── examples/             # Usage examples
├── docs/                 # Documentation
└── pyproject.toml        # Project configuration

Development Tools

Makefile Commands

make help          # Show help
make install       # Install dependencies
make dev           # Install development dependencies
make test          # Run tests
make lint          # Code linting
make format        # Code formatting
make build         # Build package
make clean         # Clean build files

Debugging

# Run in development mode
uv run python -m scriptmate --help

# Debug specific functionality
uv run python -c "from scriptmate.config import config_manager; print(config_manager.load_config())"

Release Process

  1. Update version number (src/scriptmate/__init__.py)
  2. Update CHANGELOG.md
  3. Create Git tag
  4. Build and publish package
# Build
make build

# Publish to test PyPI
make publish-test

# Publish to PyPI
make publish

Community

License

By contributing code, you agree that your contributions will be licensed under the MIT License.

Acknowledgments

Thanks to all contributors for their efforts! Your contributions make ScriptMate better.