Spaces:
Running
Running
File size: 3,595 Bytes
153d567 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# Contributing to Code Chunker
Thank you for your interest in contributing to Code Chunker! This document provides guidelines and information for contributing to this project.
## Table of Contents
- [Code of Conduct](#code-of-conduct)
- [Getting Started](#getting-started)
- [How to Contribute](#how-to-contribute)
- [Development Setup](#development-setup)
- [Pull Request Process](#pull-request-process)
- [Testing Guidelines](#testing-guidelines)
- [Style Guidelines](#style-guidelines)
## Code of Conduct
By participating in this project, you agree to maintain a respectful and inclusive environment. We expect all contributors to:
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
## Getting Started
1. Fork the repository
2. Clone your fork locally
3. Create a new branch for your feature or bugfix
4. Make your changes following our guidelines
5. Push to your fork
6. Submit a Pull Request
## How to Contribute
There are several ways to contribute to Code Chunker:
1. **Bug Reports**: Submit detailed bug reports using the GitHub issue tracker
2. **Feature Requests**: Propose new features through GitHub issues
3. **Code Contributions**: Submit Pull Requests with improvements or new features
4. **Documentation**: Help improve or translate documentation
5. **Testing**: Add or improve test coverage
## Pull Request Process
1. Update the README.md with details of changes if applicable
2. Add appropriate unit tests for any new functionality
3. Ensure all tests pass by running:
```bash
python -m unittest discover
```
4. Update documentation as needed
5. Ensure your code follows our style guidelines
6. Create a Pull Request with a clear title and description
## Testing Guidelines
- Write unit tests for all new functionality
- Maintain or improve code coverage
- Follow the existing test structure in `test_code_chunker.py`
- Test multiple file types and edge cases
- Include both positive and negative test cases
### Test Examples
- Test basic functionality with simple code files
- Test edge cases (empty files, large files)
- Test different programming languages (Python, JavaScript, CSS, etc.)
- Test with various token limits
- Test error handling scenarios
## Style Guidelines
### Python Code Style
- Follow PEP 8 guidelines
- Use type hints for function parameters and return values
- Keep functions focused and single-purpose
- Write clear docstrings for classes and functions
- Use meaningful variable and function names
### Code Organization
- Keep related functionality together
- Maintain clear separation of concerns
- Follow the existing project structure
- Use appropriate design patterns
## Language Support
When adding support for new programming languages:
1. Update the `language_extension_map` in `CodeParser.py`
2. Add appropriate node types in `_get_node_types_of_interest`
3. Include test files for the new language
4. Update documentation accordingly
## Documentation
- Keep README.md up to date
- Document all new features
- Include docstrings for new functions and classes
- Add comments for complex logic
- Update API documentation if applicable
## Questions or Need Help?
Feel free to:
- Open an issue for general questions
- Join our discussions in GitHub Discussions
- Reach out to maintainers for guidance
## License
By contributing to Code Chunker, you agree that your contributions will be licensed under the same license as the main project.
Thank you for contributing to Code Chunker! |