Contribution Guide
Contribution Guide
Section titled “Contribution Guide”Welcome to the official guide for contributing to Orionis Framework. Here you will find best practices, requirements, and workflows to collaborate effectively, ensuring quality, security, and consistency in every contribution.
Official Repositories
Section titled “Official Repositories”The Orionis Framework source code is managed on GitHub. Each component of the ecosystem has its own repository:
| Repository | Description |
|---|---|
| Orionis Framework | Framework core |
| Orionis Skeleton | Base template for new projects |
Contribution Workflow
Section titled “Contribution Workflow”The following outlines the general process for contributing to the project:
- Fork the repository you want to contribute to.
- Create a branch from the appropriate base branch (see the Branch Strategy section).
- Implement your changes following the project’s style and quality conventions.
- Include tests that validate the new or modified behavior.
- Run static analysis with Ruff and SonarQube before opening your PR.
- Open a Pull Request and mark it as Ready for review when it is complete.
- Respond to feedback from reviewers and make the necessary adjustments.
Bug Reports
Section titled “Bug Reports”For efficient collaboration, always submit your fixes via Pull Requests rather than reporting bugs through email or forums. Every fix must include tests that validate its behavior.
When reporting a bug, include:
- A clear and concise title describing the problem.
- A detailed description with expected vs. actual behavior.
- Steps to reproduce the bug consistently.
- Environment information: Python version, operating system, and Orionis version.
- A minimal reproducible code example.
Development Discussion
Section titled “Development Discussion”Have ideas for new features or improvements? Share them on the GitHub Discussions board. Contributors are encouraged to be willing to participate in the implementation, whether by contributing code or helping with development.
Not all proposals will be accepted; maintainers will evaluate each suggestion considering the project’s vision, goals, and roadmap. Proposals should provide real value and prioritize solutions that benefit the community.
Branch Strategy
Section titled “Branch Strategy”Choose the target branch for your PR based on the type of change:
| Type of Change | Target Branch | Example |
|---|---|---|
| Bug fixes | Latest stable version | 1.x |
| Minor backward-compatible improvements | Latest stable version | 1.x |
| New features or breaking changes | master | — |
Every contribution must include tests that validate the changes made. It is expected that:
- Bug fixes include at least one test that reproduces the corrected bug.
- New features include unit tests and, when applicable, integration tests.
- Tests follow the project’s existing conventions regarding structure and naming.
Before opening your PR, verify that all tests pass successfully by running the project’s complete test suite.
Compiled Files
Section titled “Compiled Files”Security Vulnerabilities
Section titled “Security Vulnerabilities”If you discover a security vulnerability, do not publish it as a public issue. Instead, send an email to Raul M. Uñate at raulmauriciounate@gmail.com. All vulnerabilities will be addressed with priority and handled confidentially.
Code Style
Section titled “Code Style”Orionis follows its own style conventions, aligned with modern web frameworks. The following requirements are mandatory for all code:
- Documentation: Every function, class, or method must include docstrings in NumPyDoc format.
- Type annotations: All parameters and return values must be typed with type hints.
- Readability: Code must be clear, consistent, and follow the project’s conventions.
Naming Convention
Section titled “Naming Convention”| Element | Convention | Example |
|---|---|---|
| Classes | PascalCase | EmailService |
| Methods | camelCase | sendEmail |
| Functions | snake_case | validate_input |
| Constants | UPPER_SNAKE_CASE | MAX_RETRIES |
Example: Class with Method
Section titled “Example: Class with Method”class EmailService:
def sendNotification(self, recipient: str, subject: str) -> bool: """ Sends an email notification.
Parameters ---------- recipient : str Recipient's email address. subject : str Email subject line.
Returns ------- bool True if the sending was successful, False otherwise. """ return TrueExample: Standalone Function
Section titled “Example: Standalone Function”def parse_config_file(file_path: str, encoding: str = "utf-8") -> dict: """ Reads and parses a configuration file.
Parameters ---------- file_path : str Absolute path to the configuration file. encoding : str, optional File encoding. Defaults to 'utf-8'.
Returns ------- dict Dictionary with the configuration key-value pairs. """ return {}Static Analysis
Section titled “Static Analysis”Orionis Framework uses two complementary tools to ensure code quality:
| Tool | Purpose |
|---|---|
| Ruff | Code linting and formatting |
| SonarQube | Static quality and security analysis |
All code must pass both analyses with no warnings or errors before submitting a PR.
Configure your environment to run Ruff and fix any warnings before submitting your contribution:
ruff check .SonarLint Configuration for VSCode
Section titled “SonarLint Configuration for VSCode”If you use Visual Studio Code, apply the following configuration in your settings.json file:
"sonarlint.rules": { "python:S100": { "level": "on", "parameters": { "format": "^_{0,2}[a-z][a-zA-Z0-9_]*_{0,2}$" } }, "python:S2638": { "level": "off" }, "python:S1542": { "level": "on", "parameters": { "format": "^_{0,2}[a-z][a-zA-Z0-9_]*_{0,2}$" } }},"sonarlint.automaticAnalysis": trueCustom Rules Reference
Section titled “Custom Rules Reference”| Rule | Status | Description |
|---|---|---|
python:S100 | Active (customized) | Allows method names in camelCase and with leading underscores, aligned with the framework’s style. |
python:S1542 | Active (customized) | Enforces consistency in function and method naming. |
python:S2638 | Disabled | Incompatible with the dependency injection syntax used in Orionis. |
Cognitive Complexity (python:S3776)
Section titled “Cognitive Complexity (python:S3776)”Some methods may exceed the default cognitive complexity threshold of 15. In such cases:
- Do not disable the rule globally.
- Use
# NOSONARsparingly and only when the complexity is justified and reviewed.
def complex_method(...): # NOSONAR # Complex logic that requires a documented exception ...Thank you for contributing to Orionis Framework! Your collaboration helps improve the quality and developer experience for the entire community.