These code guidelines are intended to ensure consistency, readability, and maintainability of the codebase for the AGREE (Aggregation for Robust Explanation Experience) API.
- Write clean and readable code that adheres to the principles of simplicity and clarity.
- Follow the naming conventions for variables, functions, and classes.
- Comment your code to provide explanations where necessary, focusing on the "why" rather than the "what".
- Use meaningful and descriptive variable and function names.
- Keep the codebase organized by following a logical folder structure.
- Remove commented-out code and unused imports.
- Follow the PEP 8 Style Guide for Python code.
- Use 4 spaces for indentation (no tabs).
- Limit lines to a maximum of 79 characters.
- Use descriptive names for variables, functions, and classes.
- Use docstrings to provide clear and concise documentation for modules, classes, and functions.
- Use type hints to indicate the expected types of function parameters and return values.
- Write unit tests to cover critical functionality and edge cases.
- Use meaningful test names that describe the behavior being tested.
- Structure tests using Arrange-Act-Assert (AAA) pattern.
- Ensure that tests are independent and do not rely on the state of other tests.
- Aim for high code coverage to minimize the risk of undiscovered bugs.
- Follow a clear and concise commit message format.
- Commit frequently and create descriptive commit messages.
- Use feature branches for new features or bug fixes.
- Keep the commit history clean and organized by squashing or rewording commits if necessary.
- Use pull requests for code review and collaboration.
Adhering to these code guidelines will help maintain a clean and consistent codebase, improve collaboration among developers, and ensure the long-term maintainability of the AGREE API.
Remember, consistency and readability are key when writing code. Strive for simplicity and clarity in your implementations.