This document outlines coding conventions and best practices to maintain consistency, readability, and quality in the CodeSyncHub project.
- Readability: Write clear, understandable code with descriptive names for functions, variables, and classes.
- Simplicity: Favor simplicity over complexity. Avoid over-engineering.
- Follow PEP 8 style guide for Python code.
- Use four spaces for indentation.
- Implement robust error handling. Avoid silent failures and use meaningful error messages.
- Write comments for complex logic or areas where clarification may be needed.
- Use docstrings for modules, classes, and functions.
- Use
flake8for linting Python code. - Run the linter locally before submitting a pull request.
- Aim for comprehensive test coverage. Write unit tests for all new code where feasible.
- Follow Python's standard
unittestframework for writing tests.
- Write clear, concise commit messages. First line should be a summary (less than 50 characters), followed by a blank line and then a more detailed explanation if needed.
- Use feature branches for new features (e.g.,
feature/new-sync-feature) and bug fixes (e.g.,bugfix/issue-fix).
- Write efficient code. Be mindful of algorithm complexity and resource usage.
- Never commit sensitive data like tokens or secrets.
- Use environment variables for configuration.