Thank you for your interest in contributing to TextEditee! This document provides guidelines and instructions for contributing.
Be respectful, inclusive, and professional in all interactions.
- Python 3.12 or higher
- Git
- Basic understanding of vim/terminal editors
- Familiarity with Python development
-
Fork and Clone
git clone https://github.com/yourusername/texteditee.git cd texteditee -
Create Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt pip install pytest pytest-cov black mypy ruff
-
Run Tests
pytest tests/ -v
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix- Follow the existing code style
- Write clean, readable code
- Add comments only when necessary
- Follow DRY, KISS, and Clean Code principles
- Add tests for new features
- Ensure existing tests pass
- Aim for high code coverage
pytest tests/ -v --cov=src/textediteeblack src/ tests/ruff check src/
mypy src/Write clear, descriptive commit messages:
git commit -m "Add feature: description of feature"
# or
git commit -m "Fix bug: description of bug fix"git push origin feature/your-feature-nameThen create a Pull Request on GitHub.
- Follow PEP 8
- Use type hints
- Maximum line length: 100 characters
- Use meaningful variable names
- Prefer composition over inheritance
from typing import Optional
class Buffer:
def __init__(self, filename: str = ''):
self.filename = filename
self.modified = False
def save(self, filename: Optional[str] = None) -> None:
target = filename or self.filename
if not target:
raise ValueError("No filename specified")
# Implementation...src/texteditee/
├── core/ # Core editor components
├── input/ # Input handling
├── ui/ # User interface
├── features/ # Editor features
├── fs/ # File system operations
└── config/ # Configuration
- Command Pattern: For undo/redo and key bindings
- Strategy Pattern: For different modes
- Singleton Pattern: For global state
- Observer Pattern: For buffer notifications
- Core Features go in
core/ - UI Components go in
ui/ - Editor Features go in
features/ - File Operations go in
fs/
import pytest
from texteditee.core.buffer import Buffer
class TestBuffer:
def test_insert_char(self):
buf = Buffer()
buf.insert_char(0, 0, 'a')
assert buf.get_line(0) == 'a'# All tests
pytest tests/
# Specific test file
pytest tests/test_buffer.py
# With coverage
pytest tests/ --cov=src/texteditee
# Verbose output
pytest tests/ -v- Use docstrings for classes and public methods
- Keep comments minimal and meaningful
- Update documentation when changing behavior
- Update
README.mdfor user-facing changes - Update
docs/user_guide.mdfor new features - Update
CHANGELOG.mdfor all changes
- Tests pass
- Code is formatted (black)
- Linters pass (ruff, mypy)
- Documentation updated
- CHANGELOG.md updated
Include:
- What the PR does
- Why the change is needed
- How to test it
- Screenshots (if UI changes)
## Description
Adds support for visual block mode
## Motivation
Users need to select rectangular blocks of text
## Changes
- Added visual block mode to mode manager
- Implemented block selection logic
- Added keybinding Ctrl+v
## Testing
1. Open file
2. Press Ctrl+v
3. Move cursor to select block
4. Press d to delete block
## Screenshots
[Add screenshots if applicable]- Check existing issues
- Ensure it aligns with project goals
- Consider if it fits the vim philosophy
Use the issue template and include:
- Clear description
- Use case
- Expected behavior
- Alternative solutions considered
- Check existing issues
- Try to reproduce
- Gather information
Include:
- TextEditee version
- Operating system
- Python version
- Steps to reproduce
- Expected vs actual behavior
- Error messages/logs
- Documentation improvements
- Test coverage
- Bug fixes
- Code cleanup
- Plugin system
- Advanced vim features
- Performance optimization
- Cross-platform improvements
- Open an issue with the "question" label
- Check existing documentation
- Review closed issues
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to TextEditee! 🎉