General Code Of Conduct
I. Follow Standards
- Consistent Style: Follow a consistent coding style and adhere to style guides (e.g., PEP 8 for Python, Google Java Style Guide). This improves readability and maintainability.
- Naming Conventions: Use descriptive and meaningful names for variables, functions, and classes. Follow established naming conventions for the language or framework you're using.
II. Code Quality
- Write Clean Code: Strive for clarity and simplicity in your code. Avoid complex logic and aim for straightforward solutions.
- Optimize Code: Write efficient code and be mindful of performance considerations. Profile and optimize code where necessary to improve speed and reduce resource usage.
- Documentation: Document your code and use comments judiciously to explain complex sections. Ensure your documentation is up-to-date and useful.
- Refactoring: Regularly refactor code to improve its structure and readability. Remove redundant code and optimize performance.
- Modular Design: Write modular and reusable code. Break down large components into smaller, manageable pieces.
- Dependency Management: Manage dependencies carefully. Use dependency management tools and avoid unnecessary or outdated libraries.
III. Testing
- Write Tests: Develop unit tests, integration tests, and end-to-end tests to verify that your code works as expected. Aim for high test coverage.
- Test-Driven Development (TDD): Consider using TDD to write tests before implementing features, ensuring that your code meets the requirements from the start.
- Continuous Integration (CI): Use CI tools to automatically run tests and build processes with each code change. This helps catch issues early.
IV. Code Reviews
- Participate in Reviews: Engage in code reviews to provide and receive constructive feedback. Focus on code quality, adherence to standards, and potential improvements.
- Review Constructively: Provide feedback that is clear, actionable, and respectful. Focus on the code and not the person.
- Too Many Comments: If your pull request receives more than 7 comments, it will be automatically closed. This indicates the need to reassess the approach to the task or to break it down into smaller, more manageable parts.
- Extended Review Process: If the pull request discussion extends to more than 3 iterations, it will also be closed. In such cases, it is recommended to conduct additional analysis, clarify requirements, or discuss potential solutions during the planning phase.