Skip to content

Commit 16707a8

Browse files
committed
Initial commit of the CONTRIBUTING docs
1 parent 41d3978 commit 16707a8

1 file changed

Lines changed: 173 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# Contribution Guidelines
2+
3+
All contributions are welcome! Please follow these guidelines to ensure a smooth contribution process.
4+
5+
## Overview
6+
7+
Here are some guidelines to help you get started:
8+
9+
1. **Raise an Issue**: Before starting work on a new feature or bug fix, please [raise an issue][new-issue] to discuss it. All enhancements and changes are discussed in the [issues section][issues]. This helps us avoid duplicate work and ensures that your contribution aligns with the project's goals.
10+
2. **Check the issues and milestones**: Look at the [issues] and [milestones] to see if your contribution fits into the current roadmap.
11+
3. **Fork the Repository**: [Create a fork][new-fork] of the repository to work on your changes. This allows you to make changes without affecting the main codebase.
12+
4. **Create a new branch**: When working on a new feature or bug fix, [create a new branch][create-branch] from the `main` branch. Use a descriptive name for your branch that reflects the changes you are making.
13+
5. **Clone the repository**: [Clone your forked repository][about-clone] to your local machine to start working on it.
14+
6. **Creating your environment**: Set up your development environment according to the project's requirements. This may include installing dependencies, setting up virtual environments, and configuring tools like [uv][uv-installation], [pre-commit][pre-commit], [pytest][pytest], and [mypy][mypy].
15+
7. **Make your changes**: Implement your changes in the new branch. Ensure that your code adheres to the project's coding standards and style guidelines.
16+
8. **Commit your changes**: Commit your changes with a clear and descriptive commit message.
17+
9. **Write tests**: If you are adding new features or fixing bugs, please write tests to ensure that your changes work as expected.
18+
10. **Submit a Pull Request**: Once you have made your changes and committed them, [submit a pull][new-pr] request to the main repository. Provide a clear description of the changes you made and reference any related issues.
19+
20+
21+
## Raise an Issue
22+
23+
If you find a bug or have a feature request, please [raise an issue][new-issue]. This helps us track and prioritize contributions effectively.
24+
25+
[<kbd>Raise an Issue</kbd>][new-issue]
26+
27+
When raising an issue, please follow these guidelines to ensure clarity and effectiveness:
28+
29+
1. **Title**: Provide a clear and concise title that summarizes the issue or feature request.
30+
2. **Description**: Include a detailed description of the issue or feature request. Explain what the problem is, how it can be reproduced, and any relevant context.
31+
3. **Steps to Reproduce**: If applicable, provide a step-by-step guide on how to reproduce the issue. This helps us understand the problem better.
32+
4. **Expected vs Actual Behavior**: Describe what you expected to happen and what actually happened. This helps clarify the issue.
33+
5. **Screenshots or Logs**: If possible, include screenshots or logs that illustrate the issue. This can be very helpful for debugging.
34+
6. **Context**: Provide any additional context that might be relevant, such as the environment in which the issue occurred (e.g., operating system, Python version, etc.).
35+
36+
37+
## Issues and Milestones
38+
39+
We are using [issues] to track bugs, feature requests, and enhancements, and [milestones] to organize these issues into manageable chunks.
40+
41+
If you want to contribute to the project, please check the current [issues] and [milestones] before starting work to ensure that your contribution aligns with the project's goals and priorities. This will help avoid duplication of effort and ensure that your contributions align with the project's roadmap. If you want to add something that is not already listed in the [milestones], please [raise an issue][new-issue] to discuss it first.
42+
43+
You can view the current [issues] and [milestones] on the project's GitHub page.
44+
45+
[<kbd>View Issues</kbd>][issues]
46+
47+
[<kbd>View Milestones</kbd>][milestones]
48+
49+
50+
## Create a Fork
51+
52+
To contribute to this project, you need to [create a fork][new-fork] of the repository. This allows you to make changes without affecting the main codebase.
53+
54+
[<kbd>Create a Fork</kbd>][new-fork]
55+
56+
57+
## Create a New Branch
58+
59+
When working on a new feature or bug fix, [create a new branch][create-branch] from the `main` branch. Use a descriptive name for your branch that reflects the changes you are making.
60+
61+
[<kbd>Create a New Branch</kbd>][create-branch]
62+
63+
64+
## Clone the Repository
65+
66+
To start working on your forked repository, you need to [clone it][about-clone] to your local machine. This allows you to make changes and test them locally before submitting a pull request.
67+
68+
69+
## Creating your Environment
70+
71+
When you are ready to start working on your changes, set up your development environment according to the project's requirements. In this project, we use [uv][uv] to manage the Python environments, [pre-commit][pre-commit] for code quality checks, and [pytest][pytest] for testing.
72+
73+
Follow these steps to set up your environment:
74+
75+
1. **Install uv**: Follow the instructions in the [uv installation guide][uv-installation] to install uv.
76+
```sh
77+
curl -LsSf https://astral.sh/uv/install.sh | sh
78+
```
79+
2. **Sync the environment**: Use [`uv`][uv] to set up the environment with the required dependencies.
80+
```sh
81+
uv sync --all-groups --link-mode=copy
82+
```
83+
3. **Install pre-commit**: Install [pre-commit][pre-commit] to manage code quality checks.
84+
```sh
85+
uv run --link-mode=copy pre-commit install
86+
```
87+
4. **Update pre-commit hooks**: Ensure that the pre-commit hooks are up to date.
88+
```sh
89+
uv run --link-mode=copy pre-commit autoupdate
90+
```
91+
92+
93+
## Make Your Changes
94+
95+
Make your changes in the new branch you created. Ensure that your code adheres to the project's coding standards and style guidelines. If you are adding new features or fixing bugs, please write tests to ensure that your changes work as expected.
96+
97+
Ensure you follow the project's coding standards and style guidelines. This includes:
98+
99+
1. **Code Style**: Follow the [PEP 8][pep8] style guide for Python code.
100+
2. **Docstrings**: Use clear and concise docstrings for all functions, classes, and modules. Ensure that they follow the [Google styleguide][google-docstrings].
101+
3. **Testing**: Write unit tests for your code using [unittest][unittest] or [pytest][pytest]. Ensure that your tests cover all new functionality and edge cases.
102+
4. **Code Coverage**: Maintain high code coverage for your tests. Use [Codecov][codecov] to check your coverage reports.
103+
5. **Type Checking**: Use [mypy][mypy] for static type checking. Ensure that your code passes all type checks.
104+
105+
Because you have set up [`pre-commit`][pre-commit], these checks will be run automatically when you commit your changes. If any checks fail, you will need to fix them before you can successfully commit your changes. Further checks will also be run when you submit a pull request, so it's a good idea to ensure your code passes all checks before proceeding.
106+
107+
108+
## Commit Your Changes
109+
110+
Once you have made your changes, commit them with a clear and descriptive commit message. This helps reviewers understand the purpose of your changes. A good commit message should:
111+
112+
- Start with a short summary of the changes (50 characters or less).
113+
- Follow the summary with a blank line.
114+
- Provide a detailed description of the changes, including why they were made and any relevant context.
115+
- Use the imperative mood (e.g., "Add feature" instead of "Added feature").
116+
- Reference any related issues or pull requests.
117+
- Use bullet points or paragraphs to organize the description for readability.
118+
- Avoid using vague terms like "fixes" or "changes" without context.
119+
- Be concise but informative, providing enough detail for someone unfamiliar with the code to understand the changes.
120+
- Avoid including unnecessary information or personal opinions.
121+
- Use proper grammar and punctuation to enhance clarity.
122+
- If applicable, include any relevant links to documentation or resources that provide additional context for the changes.
123+
- If the commit is related to a specific issue, include the issue number in the commit message (e.g., "Fixes #123").
124+
- If the commit is part of a larger feature or task, consider using a prefix like "feat:", "fix:", or "chore:" to categorize the commit (e.g., "feat: add new feature for user authentication").
125+
- If the commit is a work in progress, consider using a prefix like "WIP:" to indicate that it is not yet complete (e.g., "WIP: start implementing new feature for user authentication").
126+
- If the commit is a refactor or cleanup, consider using a prefix like "refactor:" to indicate that it does not introduce new functionality (e.g., "refactor: improve code readability and maintainability").
127+
- If the commit is a documentation update, consider using a prefix like "docs:" to indicate that it only affects documentation (e.g., "docs: update README with installation instructions").
128+
- If the commit is a test update, consider using a prefix like "test:" to indicate that it only affects tests (e.g., "test: add unit tests for new feature").
129+
130+
Ensure that any pre-commit checks pass before committing your changes. This includes code style checks, linting, and tests. If any checks fail, you will need to fix them before you can successfully commit your changes.
131+
132+
133+
## Submit a Pull Request
134+
135+
Once you have made your changes and committed them, [submit a pull request][new-pr] to the main repository. Provide a clear description of the changes you made and reference any related issues.
136+
137+
When submitting a pull request, please follow these guidelines:
138+
139+
1. **Title**: Use a clear and descriptive title that summarizes the changes you made.
140+
2. **Description**: Provide a detailed description of the changes you made, including:
141+
- What the changes do.
142+
- Why the changes were made.
143+
- Any relevant context or background information.
144+
- How to test the changes.
145+
3. **Reference Issues**: If your changes address a specific issue, reference it in the pull request description (e.g., "Fixes #123" or "Closes #123).
146+
4. **Link to Related Pull Requests**: If your changes are related to other pull requests, link to them in the description.
147+
5. **Reviewers**: Optionally, you can request specific reviewers to review your pull request.
148+
6. **Milestone**: Optionally, you can assign your pull request to a specific milestone if it is related to a larger feature or task.
149+
7. **Check for Merge Conflicts**: Ensure that your branch is up to date with the main branch and that there are no merge conflicts. If there are conflicts, resolve them before submitting the pull request.
150+
8. **Be Responsive**: Be prepared to respond to feedback from reviewers. They may request changes or ask for clarification on certain aspects of your pull request. Address their comments promptly and respectfully.
151+
9. **Be Patient**: Reviewers may take some time to review your pull request, especially if they are busy with other tasks. Be patient and give them time to provide feedback.
152+
10. **Follow Up**: After your pull request is merged, consider following up with any additional changes or improvements based on feedback from the review process. This helps maintain a high-quality codebase and shows that you are committed to improving the project.
153+
154+
[<kbd>Submit a Pull Request</kbd>][new-pr]
155+
156+
157+
[issues]: https://github.com/data-science-extensions/toolbox-python/issues
158+
[milestones]: https://github.com/data-science-extensions/toolbox-python/milestones
159+
[new-issue]: https://github.com/data-science-extensions/toolbox-python/issues/new
160+
[new-fork]: https://github.com/data-science-extensions/toolbox-python/fork
161+
[create-branch]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository
162+
[about-clone]: https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
163+
[about-pr]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests
164+
[new-pr]: https://github.com/data-science-extensions/toolbox-python/compare
165+
[uv]: https://docs.astral.sh/uv/
166+
[uv-installation]: https://docs.astral.sh/uv/getting-started/installation/
167+
[pre-commit]: https://pre-commit.com/
168+
[pep8]: https://peps.python.org/pep-0008/
169+
[google-docstrings]: https://google.github.io/styleguide/pyguide.html
170+
[unittest]: https://docs.python.org/3/library/unittest.html
171+
[pytest]: https://docs.pytest.org/
172+
[codecov]: https://codecov.io/
173+
[mypy]: https://mypy-lang.org/

0 commit comments

Comments
 (0)