5.1 KiB
5.1 KiB
Contributing Guidelines
Thank you for your interest in contributing to Edison! This guide will help you get started with contributing to the project.
Development Workflow
gitGraph
commit id: "Initial setup"
branch feature/my-feature
checkout feature/my-feature
commit id: "Implement feature"
commit id: "Add tests"
commit id: "Fix bugs"
checkout main
merge feature/my-feature
commit id: "Release v1.0.1"
Getting Started
Setting Up Your Development Environment
-
Fork the repository:
- Visit the GitHub repository and click the "Fork" button
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/command-assistant.git cd command-assistant -
Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install in development mode:
pip install -e . -
Install development dependencies:
pip install pylint pytest
Development Process
-
Create a branch:
git checkout -b feature/my-feature-name -
Make your changes:
- Write code
- Add tests
- Update documentation
-
Run tests and linting:
# Run tests (future addition) pytest # Run linting pylint edison -
Commit your changes:
git add . git commit -m "Descriptive commit message" -
Push to your fork:
git push origin feature/my-feature-name -
Submit a pull request:
- Go to your fork on GitHub
- Click "New Pull Request"
- Select your branch and submit
Code Style and Guidelines
Python Style Guide
Edison follows PEP 8 with some additional guidelines:
- Use 4 spaces for indentation
- Maximum line length of 100 characters
- Use meaningful variable and function names
- Write docstrings for all classes and functions
Docstring Format
We use Google-style docstrings:
def example_function(param1, param2):
"""
Brief description of the function.
Args:
param1: Description of param1
param2: Description of param2
Returns:
Description of return value
Raises:
ExceptionType: When and why this exception is raised
"""
pass
Code Organization
- Keep functions focused on a single responsibility
- Group related functionality in modules
- Use appropriate error handling
- Add useful log messages
Adding New Features
When adding new features:
- Start by discussing: Open an issue to discuss your proposed feature
- Design the interface: How will users interact with your feature?
- Plan the implementation: Sketch out the implementation before coding
- Write tests: Add tests to verify your feature works correctly
- Document the feature: Update or add documentation explaining the feature
- Submit for review: Submit a pull request for review
Release Process
flowchart TD
A[Feature Development] --> B[Testing]
B --> C[Code Review]
C --> D{Approved?}
D -->|No| B
D -->|Yes| E[Merge to Main]
E --> F[Version Bump]
F --> G[Release]
style A fill:#f9d5e5,stroke:#333,stroke-width:2px
style B fill:#eeeeee,stroke:#333,stroke-width:2px
style C fill:#d3f6db,stroke:#333,stroke-width:2px
style D fill:#d3f6f5,stroke:#333,stroke-width:2px
style E fill:#f5d5f5,stroke:#333,stroke-width:2px
style F fill:#f5d5d5,stroke:#333,stroke-width:2px
style G fill:#d5d5f5,stroke:#333,stroke-width:2px
Edison follows semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR: Incompatible API changes
- MINOR: Backwards-compatible new features
- PATCH: Backwards-compatible bug fixes
Future Development Areas
We're looking for contributions in these areas:
- Testing Framework: Adding a comprehensive test suite
- Documentation: Expanding and improving documentation
- Supported Shells: Adding support for additional shells
- Platform Support: Enhancing cross-platform compatibility
- Model Support: Adding support for alternative AI models
- Command Validation: Improving safety checks
- Interactive Features: Enhancing the interactive shell
- Performance Optimization: Improving response times
Best Practices
Security Considerations
- Never commit API keys or sensitive information
- Validate user input thoroughly
- Use safe subprocess execution methods
- Be careful with permissions and file operations
Performance
- Minimize API calls where possible
- Use efficient algorithms and data structures
- Avoid unnecessary file I/O
- Profile code to identify bottlenecks
User Experience
- Provide clear feedback to users
- Use consistent command-line interfaces
- Add helpful error messages
- Consider accessibility in your design
Getting Help
If you need help with contributing:
- Open an issue on GitHub
- Check existing documentation
- Reach out to maintainers
Thank you for contributing to Edison!