Skip to content

Commit cb51226

Browse files
committed
docs update for pre-commit
1 parent 2e1ad82 commit cb51226

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,38 @@ We use pull requests for code contributions. To submit a pull request:
1414

1515
1. Fork the repository.
1616
2. Create a new branch for your feature or bug fix.
17-
3. Make your changes and commit them with clear and concise messages.
17+
3. Make your changes and commit them with clear and concise messages. Refer [Making Commits](#making-commits)
1818
4. Push your changes to your fork.
1919
5. Submit a pull request to the main repository, detailing the changes you've made and referencing any relevant issues.
2020

2121
## Code Style
2222

23-
Please follow the existing code style and conventions used in the project. If you're unsure, feel free to ask for clarification in the pull request or issue comments.
23+
Please follow the existing code style and conventions used in the project. If you're unsure, feel free to ask for clarification in the pull request or issue comments. For linting and all refer [Making Commits](#making-commits)
24+
25+
## Making Commits
26+
27+
1. Pre-commit should be installed as a dev dependency already. If not run the follwoing command from project root dir:
28+
```
29+
pip install backend/dev-requirements.txt --upgrade
30+
```
31+
Then install it:
32+
```
33+
pre-commit install
34+
```
35+
2. Then after adding the changes to staging, commit it normally. You will observe pre-commit hooks running.
36+
37+
*NOTE*: The pre-commit hooks modifies the files and you have to again add the modified changes to staging and then commit
38+
39+
3. You can run the pre-commit without committing anything as
40+
```
41+
pre-commit run --all-files
42+
```
43+
or
44+
```
45+
pre-commit run --files [path/to/file]
46+
```
47+
48+
*NOTE*: Make sure the terminal is using node 16 for the linting before committing(Until we upgrade node for webserver)
2449
2550
## Labels
2651

0 commit comments

Comments
 (0)