Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
- Neovim 0.8.0+
- Python 3.8+
- Git
- Claude Code CLI
-
Fork and clone the repository:
git clone https://github.com/jkhas8/claude-code-nvim.git cd claude-code-nvim -
Set up the development environment:
# Install Python dependencies cd file-watcher python3 -m venv venv source venv/bin/activate pip install -r requirements.txt pip install -r requirements-dev.txt # Development dependencies # Run tests cd .. ./test_integration.sh
-
Install pre-commit hooks (optional but recommended):
pip install pre-commit pre-commit install
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes:
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
-
Test your changes:
# Run integration tests ./test_integration.sh # Test Python code cd file-watcher python -m pytest tests/ # Test Neovim plugin (if you have plenary.nvim) nvim --headless -c "PlenaryBustedDirectory nvim-plugin/tests/"
-
Commit your changes:
git add . git commit -m "feat: add your feature description"
-
Push and create a pull request:
git push origin feature/your-feature-name
We use Conventional Commits:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(nvim): add accept/reject keybindings
fix(watcher): resolve file change detection race condition
docs: update installation instructions- Style: Follow PEP 8
- Formatting: Use
blackfor code formatting - Linting: Use
flake8for linting - Type hints: Use type hints where appropriate
- Docstrings: Use Google-style docstrings
def process_change(file_path: str, change_type: str) -> bool:
"""Process a file change event.
Args:
file_path: Path to the changed file
change_type: Type of change (CREATE, MODIFY, DELETE)
Returns:
True if change was processed successfully
"""
pass- Style: Follow LuaRocks style guide
- Formatting: Use consistent indentation (2 spaces)
- Comments: Document complex functions
- Error handling: Use
pcallfor potentially failing operations
--- Process file change from watcher
-- @param change table: Change data from watcher
-- @return boolean: Success status
local function process_change(change)
-- Implementation
end- Unit Tests: Test individual functions
- Integration Tests: Test component interactions
- End-to-end Tests: Test complete workflows
# All tests
./test_integration.sh
# Python unit tests
cd file-watcher
python -m pytest tests/ -v
# Neovim plugin tests
cd nvim-plugin
nvim --headless -c "PlenaryBustedDirectory tests/"Python Tests:
# file-watcher/tests/test_diff.py
import pytest
from watcher import DiffCalculator
def test_diff_calculation():
calc = DiffCalculator()
old_text = "line 1\nline 2"
new_text = "line 1\nline 2 modified"
diff = calc.calculate_diff(old_text, new_text)
assert diff['hunks'][0]['type'] == 'delete'Lua Tests:
-- nvim-plugin/tests/test_config_spec.lua
local config = require('claude-code-nvim.config')
describe('config', function()
it('should have default values', function()
local defaults = config.setup({})
assert.is_true(defaults.auto_start)
end)
end)When reporting bugs, please include:
-
Environment information:
- OS and version
- Neovim version
- Python version
- Claude Code CLI version
-
Steps to reproduce
-
Expected vs actual behavior
-
Logs/error messages
-
Minimal configuration (if applicable)
Use the bug report template when creating issues.
For feature requests:
- Check existing issues first
- Describe the use case clearly
- Explain the expected behavior
- Consider implementation complexity
Use the feature request template when creating issues.
- API documentation
- Configuration options
- Troubleshooting guides
- Architecture explanations
- Use Markdown for all documentation
- Include code examples where relevant
- Keep explanations clear and concise
- Add screenshots/GIFs for UI features
- Ensure tests pass
- Update documentation if needed
- Add changelog entry (unreleased section)
- Request review from maintainers
- Address feedback promptly
- Code follows project style guidelines
- Tests pass locally
- Documentation updated (if applicable)
- Changelog updated
- No merge conflicts
- PR description is clear
Releases follow Semantic Versioning:
- Major (X.0.0): Breaking changes
- Minor (0.X.0): New features, backward compatible
- Patch (0.0.X): Bug fixes, backward compatible
- Issues: Create a GitHub issue
- Discussions: Use GitHub Discussions for questions
- Discord: Join our community Discord (link in README)
Contributors will be recognized in:
- README.md contributors section
- CHANGELOG.md for each release
- GitHub releases notes
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to make Claude Code + Neovim integration better for everyone! 🎉