Skip to content

Commit 161ab90

Browse files
Enhancing the contributing.md file (k2-fsa#1351)
1 parent 7d56685 commit 161ab90

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

contributing.md

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,37 @@
1+
# Contributing to Our Project
12

2-
## Pre-commit hooks
3+
Thank you for your interest in contributing to our project! We use Git pre-commit hooks to ensure code quality and consistency. Before contributing, please follow these guidelines to enable and use the pre-commit hooks.
34

4-
We use [git][git] [pre-commit][pre-commit] [hooks][hooks] to check that files
5-
going to be committed:
5+
## Pre-Commit Hooks
66

7-
- contain no trailing spaces
8-
- are formatted with [black][black]
9-
- are compatible to [PEP8][PEP8] (checked by [flake8][flake8])
10-
- end in a newline and only a newline
11-
- contain sorted `imports` (checked by [isort][isort])
7+
We have set up pre-commit hooks to check that the files you're committing meet our coding and formatting standards. These checks include:
128

13-
These hooks are disabled by default. Please use the following commands to enable them:
9+
- Ensuring there are no trailing spaces.
10+
- Formatting code with [black](https://github.com/psf/black).
11+
- Checking compliance with PEP8 using [flake8](https://flake8.pycqa.org/).
12+
- Verifying that files end with a newline character (and only a newline).
13+
- Sorting imports using [isort](https://pycqa.github.io/isort/).
1414

15-
```bash
16-
pip install pre-commit # run it only once
17-
pre-commit install # run it only once, it will install all hooks
15+
Please note that these hooks are disabled by default. To enable them, follow these steps:
1816

19-
# modify some files
20-
git add <some files>
21-
git commit # It runs all hooks automatically.
17+
### Installation (Run only once)
2218

23-
# If all hooks run successfully, you can write the commit message now. Done!
24-
#
25-
# If any hook failed, your commit was not successful.
26-
# Please read the error messages and make changes accordingly.
27-
# And rerun
19+
1. Install the `pre-commit` package using pip:
20+
```bash
21+
pip install pre-commit
22+
```
23+
1. Install the Git hooks using:
24+
```bash
25+
pre-commit install
26+
```
27+
### Making a Commit
28+
Once you have enabled the pre-commit hooks, follow these steps when making a commit:
29+
1. Make your changes to the codebase.
30+
2. Stage your changes by using git add for the files you modified.
31+
3. Commit your changes using git commit. The pre-commit hooks will run automatically at this point.
32+
4. If all hooks run successfully, you can write your commit message, and your changes will be successfully committed.
33+
5. If any hook fails, your commit will not be successful. Please read and follow the error messages provided, make the necessary changes, and then re-run git add and git commit.
2834

29-
git add <some files>
30-
git commit
31-
```
35+
### Your Contribution
36+
Your contributions are valuable to us, and by following these guidelines, you help maintain code consistency and quality in our project. We appreciate your dedication to ensuring high-quality code. If you have questions or need assistance, feel free to reach out to us. Thank you for being part of our open-source community!
3237

33-
[git]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
34-
[flake8]: https://github.com/PyCQA/flake8
35-
[PEP8]: https://www.python.org/dev/peps/pep-0008/
36-
[black]: https://github.com/psf/black
37-
[hooks]: https://github.com/pre-commit/pre-commit-hooks
38-
[pre-commit]: https://github.com/pre-commit/pre-commit
39-
[isort]: https://github.com/PyCQA/isort

0 commit comments

Comments
 (0)