I welcome contributions from the community! To ensure a smooth and efficient collaboration process, please adhere to the following Contribution Standards designed to maintain high code quality and consistency.
- Code of Conduct
- How to Contribute
- Code Style Guidelines
- Testing
- Commit Guidelines
- Pull Request Process
- Additional Resources
Please read and follow our Code of Conduct to ensure a welcoming and respectful community for everyone.
If you find a bug in CodeFuse, please follow these steps:
-
Check Existing Issues:
Ensure that the bug hasn't already been reported by searching existing issues. -
Open a New Issue:
If the bug is new, open a Bug Report and provide the following information:- Description: A clear and concise description of what the bug is.
- To Reproduce: Steps to reproduce the behavior.
- Expected Behavior: A clear and concise description of what you expected to happen.
- Screenshots: If applicable, add screenshots to help explain your problem.
- Environment: Information about your system (OS, Python version, etc.).
- Additional Context: Any other context about the problem.
To request new features, please:
-
Search Existing Issues:
Check if the feature has already been requested by searching existing issues. -
Open a New Feature Request:
Provide a detailed description by opening a Feature Request.
For suggestions on improving CodeFuse:
- Open an Improvement Request:
Use the Refactor / Improvement Request template to propose enhancements.
Maintaining a consistent code style is vital for readability and maintainability. Please adhere to the following guidelines:
-
Follow PEP 8:
Adhere to PEP 8, the Python style guide. -
Use Type Hints:
Utilize type annotations for better code clarity and to aid tools like linters and IDEs. -
Consistent Naming Conventions:
- Use
snake_casefor functions and variables. - Use
CamelCasefor classes. - Constants should be in
UPPER_SNAKE_CASE.
- Use
-
Documentation:
- Write clear and concise docstrings for all modules, classes, and functions using Google Style or NumPy Style.
- Ensure all public APIs are well-documented.
-
Modular Code:
- Keep functions and classes focused and limited to single responsibilities.
- Avoid large, monolithic functions; break them down into smaller, reusable components.
Comprehensive testing ensures the reliability and stability of CodeFuse.
-
Write Unit Tests:
- Cover all critical functionalities.
- Use pytest as the testing framework.
-
Test Coverage:
- Aim for at least 80% test coverage.
- Use tools like coverage.py to measure coverage.
-
Continuous Integration (CI):
- Ensure that all tests pass before merging any pull requests.
- GitHub Actions is configured to run tests on each push and pull request.
Clear and meaningful commit messages are essential for tracking changes and understanding the project history.
-
Follow Conventional Commits:
Structure your commit messages as follows:<type>[optional scope]: <description> [optional body] [optional footer(s)]Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the code (white-space, formatting, etc.)refactor: A code change that neither fixes a bug nor adds a featuretest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools and libraries
Example:
feat(cli): add support for custom templates
To ensure smooth and efficient code reviews, please follow this process when submitting pull requests (PRs):
-
Fork the Repository:
Create a personal fork of the project repository. -
Create a New Branch:
Branch off frommainusing a descriptive name.git checkout -b feature/your-feature-name
-
Make Your Changes:
Implement your feature or fix, adhering to the code style guidelines. -
Write Tests:
Add or update tests to cover your changes. -
Run Tests Locally:
Ensure all tests pass before submitting.pytest
-
Commit Your Changes:
Use clear and descriptive commit messages following the commit guidelines.git commit -m "feat(cli): add support for custom templates" -
Push to Your Fork:
git push origin feature/your-feature-name
-
Open a Pull Request:
- Navigate to the original repository.
- Click on "New Pull Request."
- Provide a clear description of your changes, referencing any relevant issues.
-
Address Feedback:
Be responsive to review comments and make necessary adjustments. -
Merge:
Once approved, your PR can be merged by the project maintainers.
-
Issue Templates:
Utilize the predefined issue templates for reporting bugs and requesting features. -
Documentation:
Refer to the CodeFuse Documentation for detailed usage instructions and API references. -
Code of Conduct:
Adhere to the Code of Conduct to maintain a respectful and inclusive community.