|
1 |
| -# How to Contribute |
| 1 | +# Contributing Guide |
2 | 2 |
|
3 |
| -## Install Development Dependencies (Using Pipenv) |
| 3 | +Thank you for your interest in contributing to the **commitlint** project! |
| 4 | +Your contributions will help improve and enhance this tool. |
| 5 | +Please take a moment to review the following guidelines before getting started. |
4 | 6 |
|
5 |
| -All the dependencies are managed by Pipenv. Please install Pipenv on your system first by following the instructions at [https://pipenv.pypa.io/en/latest/installation.html](https://pipenv.pypa.io/en/latest/installation.html). |
| 7 | +## Prerequisites |
6 | 8 |
|
7 |
| -Once Pipenv is installed, you can install the development dependencies by running the following command: |
| 9 | +Before contributing, ensure that you have the following: |
| 10 | + |
| 11 | +- **Python 3.10 or higher** installed. Download it from the [official Python website](https://www.python.org/downloads/). |
| 12 | +- **Poetry** installed for dependency management. Follow the [Poetry installation guide](https://python-poetry.org/docs/#installation). |
| 13 | + |
| 14 | +## Getting Started |
| 15 | + |
| 16 | +To set up the project on your local machine, follow these steps: |
| 17 | + |
| 18 | +1. **Fork** the repository on GitHub. |
| 19 | +2. **Clone** the forked repository to your local machine: |
| 20 | + |
| 21 | + ```bash |
| 22 | + git clone https://github.com/<your-username>/commitlint.git |
| 23 | + cd commitlint |
| 24 | + ``` |
| 25 | + |
| 26 | +3. **Install dependencies**: |
| 27 | + |
| 28 | + ```bash |
| 29 | + poetry install |
| 30 | + ``` |
| 31 | + |
| 32 | +4. **Verify your setup**: |
| 33 | + |
| 34 | + ```bash |
| 35 | + poetry run commitlint --version |
| 36 | + ``` |
| 37 | + |
| 38 | +## Tests |
| 39 | + |
| 40 | +Run tests |
8 | 41 |
|
9 | 42 | ```bash
|
10 |
| -pipenv install --dev |
| 43 | +poetry run pytest |
11 | 44 | ```
|
12 | 45 |
|
13 |
| -## Install pre-commit hooks |
| 46 | +Run tests with coverage |
| 47 | + |
| 48 | +```bash |
| 49 | +poetry run pytest --cov=src |
| 50 | +``` |
14 | 51 |
|
15 |
| -To install pre-commit and commit-msg hook for this project, run the following command: |
| 52 | +Generate html coverage |
16 | 53 |
|
17 | 54 | ```bash
|
18 |
| -pipenv run install-hooks |
| 55 | +poetry run pytest --cov=src/ --cov-report=html |
19 | 56 | ```
|
20 | 57 |
|
21 |
| -## Run tests |
| 58 | +## Use pre-commit hook |
22 | 59 |
|
23 |
| -Run the tests using the below command: |
| 60 | +Install pre-commit hook using the command below. |
24 | 61 |
|
25 | 62 | ```bash
|
26 |
| -pipenv run test |
| 63 | +poetry run pre-commit install --hook-type pre-commit --hook-type commit-msg |
27 | 64 | ```
|
28 | 65 |
|
29 |
| -## Before submitting |
| 66 | +## Pull Requests |
| 67 | + |
| 68 | +We welcome and appreciate pull requests from the community. To contribute: |
| 69 | + |
| 70 | +1. **Fork** the repository and create a new branch based on the `main` branch: |
| 71 | + |
| 72 | + ```bash |
| 73 | + git checkout -b <your-branch-name> |
| 74 | + ``` |
| 75 | + |
| 76 | +2. **Write tests** for your changes if applicable. |
| 77 | +3. **Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)** for commit messages. |
| 78 | + Examples: |
| 79 | + |
| 80 | + - `feat: add commit message validation` |
| 81 | + - `fix(parser): resolve message parsing issue` |
| 82 | + |
| 83 | +4. **Push** your branch to your forked repository: |
| 84 | + |
| 85 | + ```bash |
| 86 | + git push origin <your-branch-name> |
| 87 | + ``` |
| 88 | + |
| 89 | +5. **Create a Pull Request**: |
| 90 | + |
| 91 | + - Open a pull request from your branch to the `main` branch of the original repository. |
| 92 | + - Provide a clear and concise description of the changes, along with relevant context. |
| 93 | + |
| 94 | +6. **Review & Feedback**: |
| 95 | + |
| 96 | + - Participate in the code review process and address any feedback promptly. |
| 97 | + |
| 98 | +## License |
| 99 | + |
| 100 | +By contributing to this project, you agree that your contributions will be licensed under the **GPL-3.0 License**. |
| 101 | +Refer to the [LICENSE](./LICENSE) file for more details. |
30 | 102 |
|
31 |
| -Before submitting your Pull Request, please do the following steps: |
| 103 | +## Other Ways to Contribute |
32 | 104 |
|
33 |
| -1. Add any changes you want. |
34 |
| -1. Add tests for the new changes. |
35 |
| -1. Edit documentation (`README.md`) if you have changed something significant. |
36 |
| -1. Commit your changes using [semantic commit message](https://seesparkbox.com/foundry/semantic_commit_messages). |
37 |
| - Examples: `"fix: Fixed foobar bug"`, `"feat(accounts): Added foobar feature on accounts"`. |
| 105 | +Even if you don’t contribute code, you can still help: |
38 | 106 |
|
39 |
| -## Other help |
| 107 | +- **Spread the word** about this tool. |
| 108 | +- Write a blog or article about how you use this project. |
| 109 | +- Share your best practices, examples, or ideas with us. |
40 | 110 |
|
41 |
| -You can contribute by spreading a word about this library. |
42 |
| -It would also be a huge contribution to write a short article on how you are using this project. |
43 |
| -You can also share your best practices with us. |
| 111 | +Thank you for contributing to **commitlint**! 🎉 |
0 commit comments