Thank you for considering contributing to our project! To ensure a smooth workflow and maintain high standards of code quality, we’ve outlined the following guidelines. Please read them carefully before starting any contributions.
-
Fork the repository to your own GitHub account by clicking the Fork button.
-
Clone the forked repository to your local machine:
git clone https://github.com/your-username/allocate.git cd allocate
-
Install dependencies:
npm install
-
Run tests to make sure everything is working correctly:
npx nx run-many -t lint test -p util-hooks util-data-values util-formatting ui-components ui service
We follow the Git Flow branching model to keep development organized. Here’s the flow:
main
: Contains the production-ready code. Only release versions should be merged here.feature/*
: All new features should be developed in their own branch starting withfeature/
. Example:feature/add-login
.
-
Create a new branch for your work from
main
:git checkout -b feature/your-feature-name
-
Make your changes in the new branch and ensure that they meet the coding standards.
To maintain a clean codebase, please adhere to the following coding conventions:
- Code Style: Follow the JavaScript Style Guide. Use ESLint to enforce style rules. Check for linting on every change.
- Naming Conventions: Use camelCase for variables and functions, PascalCase for React components.
- Comments: Write clear, concise comments where necessary. All functions and complex logic should be documented.
- Code Style: Follow PEP 8 for Python coding standards.
- Docstrings: All functions should be documented with proper docstrings.
- Unit Tests: Add unit tests for any new functionality using Jest (for JavaScript/React) or pytest (for Python).
- Test Coverage: Aim for at least 80% coverage for new features.
When you’ve finished making changes:
-
Ensure your code is up-to-date with the latest
develop
branch:git fetch origin git checkout develop git pull
-
Rebase your feature branch:
git checkout feature/your-feature-name git rebase main
-
Run all tests to ensure everything works as expected:
npx nx run-many -t lint test -p util-hooks util-data-values util-formatting ui-components ui service
-
Push your branch to your forked repository:
git push origin feature/your-feature-name
-
Open a Pull Request:
- Go to your repository on GitHub.
- Click the New Pull Request button.
- Select
main
as the base branch and yourfeature/your-feature-name
branch to merge. - Provide a descriptive title and detailed description of your changes.
- Ensure that your code passes all CI checks (build, lint, and tests).
- Add relevant documentation for any new features.
- Reference any relevant issue(s) in the description.
- Add the appropriate labels to your PR (e.g.,
bug
,enhancement
,documentation
).
We are committed to fostering a welcoming and inclusive environment for all contributors. By participating, you agree to abide by our Code of Conduct, which includes:
- Be respectful and constructive in communication.
- Avoid harassment, discrimination, or offensive language.
- Welcome contributions from all individuals regardless of background.
If you encounter any issues or bugs, feel free to open an issue on GitHub. Before doing so, please:
- Search for any existing issues to avoid duplicates.
- If no issue exists, open a new one with a clear and concise description of the problem, steps to reproduce, and relevant details (e.g., screenshots, error logs).
We welcome feature requests! To suggest a new feature:
- Open an issue labeled as
enhancement
. - Clearly explain the feature and its potential benefits.
- Engage in discussion with maintainers and other contributors to refine the idea.
By contributing to this project, you agree that your contributions will be licensed under the MIT License.
By following these guidelines, we aim to create a positive and efficient collaboration experience for everyone involved. We appreciate your contributions and look forward to building great things together!