|
1 | | -# Contributing to *hydroDL2* |
| 1 | +# Contributing to *HydroDL2* |
2 | 2 |
|
3 | 3 | Thank you for considering contributing to this project! Whether it's fixing a bug, improving documentation, or adding a new feature, we welcome contributions. |
4 | 4 |
|
5 | | -We have a minimal set of standards we would ask you to consider to speed up the review process. |
| 5 | +There is a minimal set of standards we would ask you to consider to speed up the review process. |
6 | 6 |
|
7 | 7 | ## 🧭 How to Contribute |
8 | 8 |
|
9 | 9 | 1. **Fork the repository** |
10 | | - - If you have not already done so, create a fork of the hydroDL2 repo (master branch) and make changes to this copy. |
| 10 | + - If you have not already done so, create a fork of the `hydrodl2` repo (master branch) and make changes to this copy. |
11 | 11 |
|
12 | 12 | 2. **Lint & test your code** |
13 | | - - If you have not already, install development packages for hydroDL2. |
| 13 | + - Make sure development packages for HydroDL2 are installed. This can be done by flagging dev packages during pip install like `uv pip install "./hydrodl2[dev]`. |
14 | 14 |
|
15 | | - - When your changes are ready, run |
| 15 | + - Once your changes are complete, run the following in your Python environement: |
16 | 16 |
|
17 | 17 | ```bash |
18 | 18 | cd ./hydrodl2 |
19 | | - |
20 | | - isort . |
21 | | - |
22 | | - ruff check . |
23 | 19 |
|
24 | 20 | pytest tests |
| 21 | + |
| 22 | + pre-commit install |
| 23 | + |
| 24 | + git add . |
| 25 | + |
| 26 | + git commit -m 'your commit message' |
25 | 27 | ``` |
26 | 28 |
|
27 | | - - If there ruff or pytest report any errors, please try to correct these if possible. (We can also help in the next step). |
| 29 | + Upon committing, pre-commit will run a series of checks according to `.pre-commit-config.yaml` lint and format your code. This will block your commit if changes are made or requested. If manual changes are required, you will be notified. If only automatic changes are made, simply perform the git add and commit once more to push your code. |
| 30 | + |
| 31 | + Note: if pytest does not work, try `python -m pytest`. |
| 32 | + |
| 33 | + - If ruff or pytest report any errors, please try to correct these if possible. Otherwise, do `pre-commit uninstall` to proceed with committing your code and we can help in the next step. |
28 | 34 |
|
29 | 35 | 3. **Make a pull request (PR)** |
30 | | - - When you are ready make a PR to the hydroDL2 repository master branch. |
| 36 | + - When you are ready, make a PR of your fork to the HydroDL2 repository master branch. |
31 | 37 |
|
32 | | - - In the PR description, make sure to include enough detail so that we can understand the changes made and rationale if necessary. |
| 38 | + - In the PR description, include enough detail so that we can understand the changes made and rationale if necessary. |
33 | 39 |
|
34 | | - - If hydroDL2 master branch has new commits not included in your forked version, we would ask you to merge these new changes into your fork before we accept the PR. We can assist with this if necessary. |
| 40 | + - If the HydroDL2 master branch has new commits not included in your forked version, we would ask you to merge these new changes into your fork before we accept the PR. We can assist with this if necessary. |
0 commit comments