|
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: |
8 | 10 |
|
9 |
| -```bash |
10 |
| -pipenv install --dev |
11 |
| -``` |
| 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 | + ``` |
12 | 31 |
|
13 |
| -## Install pre-commit hooks |
| 32 | +4. **Verify your setup**: |
14 | 33 |
|
15 |
| -To install pre-commit and commit-msg hook for this project, run the following command: |
| 34 | + ```bash |
| 35 | + poetry run commitlint --version |
| 36 | + ``` |
| 37 | + |
| 38 | +## Tests |
| 39 | + |
| 40 | +Run tests |
16 | 41 |
|
17 | 42 | ```bash
|
18 |
| -pipenv run install-hooks |
| 43 | +poetry run pytest |
19 | 44 | ```
|
20 | 45 |
|
21 |
| -## Run tests |
22 |
| - |
23 |
| -Run the tests using the below command: |
| 46 | +Run tests with coverage |
24 | 47 |
|
25 | 48 | ```bash
|
26 |
| -pipenv run test |
| 49 | +poetry run pytest --cov=src |
27 | 50 | ```
|
28 | 51 |
|
29 |
| -## Before submitting |
| 52 | +Generate html coverage |
30 | 53 |
|
31 |
| -Before submitting your Pull Request, please do the following steps: |
| 54 | +```bash |
| 55 | +poetry run pytest --cov=src/ --cov-report=html |
| 56 | +``` |
32 | 57 |
|
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"`. |
| 58 | +## Use pre-commit hook |
38 | 59 |
|
39 |
| -## Other help |
| 60 | +Install pre-commit hook using the command below. |
40 | 61 |
|
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. |
| 62 | +```bash |
| 63 | +poetry run pre-commit install --hook-type pre-commit --hook-type commit-msg |
| 64 | +``` |
0 commit comments