This page outlines the coding standards for contributors to our project. By adhering to these standards, we ensure consistency and maintainability of our codebase.
General Guidelines
- Indentation: Use 4 spaces for indentation.
- File Encoding: All files should be saved in UTF-8 without BOM.
- Naming Conventions: Use clear and descriptive names for variables, functions, and classes.
- Comments: Write clear and concise comments to explain the purpose and functionality of code.
Code Formatting
- Braces: Always use braces
{}
around single-line blocks of code. - Whitespace: Avoid unnecessary whitespace and ensure consistent spacing.
- Line Length: Keep lines under 80 characters for better readability.
Version Control
- Use Git for version control.
- Commit changes frequently with descriptive commit messages.
- Pull requests should be reviewed and merged by other contributors.
Testing
- Write unit tests for all new code.
- Use continuous integration to run tests automatically.
Documentation
- Maintain up-to-date documentation for the codebase.
- Include inline comments to explain complex logic.
Resources
For more detailed information, please refer to our Developer Guide.
Code Quality