When contributing to Aegis, please adhere to the following coding standards to ensure consistency and readability throughout the codebase.
- Use Python 3.8 or higher for development.
- Follow PEP 8 style guide for Python code.
- Use 4 spaces for indentation.
- Limit all lines to a maximum of 79 characters for code and 72 for docstrings.
- Use descriptive and meaningful names for variables, functions, classes, and modules.
- Follow the
snake_case
naming convention for functions and variables. - Follow the
CamelCase
naming convention for classes.
- Use absolute imports rather than relative imports.
- Avoid wildcard imports (
from module import *
). - Group imports in the following order:
- Standard library imports.
- Related third-party imports.
- Local application/library specific imports.
- Write clear and concise comments. Comments should explain why, not what (unless the code is particularly complex).
- Avoid unnecessary comments if the code is self-explanatory.
- Include docstrings for all modules, classes, and public methods/functions.
- Follow the Google Style Python Docstrings format.
- Only catch exceptions that you can handle effectively.
- Avoid using a bare
except
clause.
- Write unit tests for your code using a testing framework such as
pytest
. - Ensure that all tests pass before submitting a pull request.
- Commit messages should be clear, concise, and written in the present tense.
- Follow the conventional commits format for commit messages.
- Ensure that your changes pass all CI checks before submitting a pull request.
Adhering to these coding standards will help maintain a clean and cohesive codebase. Thank you for contributing to Aegis!