Skip to content

Rules of code

Josias KABORE edited this page Apr 3, 2025 · 3 revisions

Rules for the project

1. Code Style and Formatting

  • Use consistent indentation (spaces or tabs, but be consistent)
  • Keep lines at a reasonable length (typically 80-120 characters)
  • Use meaningful and descriptive names for variables, functions, and classes
  • Write code in English (variable names, comments, documentation)

2. Documentation

  • Include a clear README.md with:
    • Project description
    • Installation instructions
    • Usage examples
    • Contributing guidelines
  • Document all public APIs and functions
  • Add inline comments for complex logic
  • Keep documentation up-to-date with code changes

3. Version Control

  • Write clear, descriptive commit messages
  • Make small, focused commits
  • Use feature branches for development
  • Follow semantic versioning (MAJOR.MINOR.PATCH)
  • Never commit sensitive information (passwords, API keys)

4. Testing

  • Write unit tests for new features
  • Maintain good test coverage
  • Ensure all tests pass before submitting changes
  • Include both positive and negative test cases
  • Document test procedures and requirements

6. Error Handling

  • Handle errors and edge cases appropriately
  • Use proper exception handling
  • Provide meaningful error messages
  • Log errors and important events
  • Fail gracefully when possible

9. Collaboration

  • Review others' code respectfully
  • Provide constructive feedback
  • Be open to suggestions and improvements
  • Help maintain project documentation
  • Follow the project's code of conduct

Clone this wiki locally