Add pre-commit to CONTRIBUTING.md (#305)

* Add pre-commit to CONTRIBUTING.md

* Update PR template
This commit is contained in:
redphix
2022-10-25 23:21:27 +05:30
committed by GitHub
parent 12222d3fbd
commit f21a15b2bd
2 changed files with 16 additions and 9 deletions

View File

@ -2,4 +2,4 @@
Fixes #<PR_NUMBER/> Fixes #<PR_NUMBER/>
## Checklist before merging ## Checklist before merging
- [ ] If it's a frontend feature, I have ran prettier `cd frontend; npm run format`. If it's a mobile app feature I ran `cd mobile; npm run format`. - [ ] Make sure you have installed and initialized [pre-commit](https://pre-commit.com). `pip install pre-commit` and `pre-commit install`

View File

@ -21,13 +21,20 @@ Discussion about code changes happens in GitHub issues and pull requests.
All RoboSats contributors submit changes via pull requests. The workflow is as follows: All RoboSats contributors submit changes via pull requests. The workflow is as follows:
- Fork the repository 1. Fork the repository
- Create a topic branch from the `main` branch 2. Create a topic branch from the `main` branch
- Commit patches 3. Install [pre-commit](https://pre-commit.com/#installation) and initialize it:
- Run formatter if the frontend was changed: `npm run format` - ```
- Squash redundant or unnecessary commits pip install pre-commit
- Submit a pull request from your topic branch back to the `main` branch of the main repository ```
- Make changes to the pull request if reviewers request them and request a re-review - ```
pre-commit install
```
Pre-commit installs git hooks that automatically checks the codebase for styleguide consistencies and runs formatters like prettier and black and performs other chores automatically on git events (mostly before a commit). If the pre-commit fails when you commit your changes, please fix the problems it points out.
4. Commit patches
6. Squash redundant or unnecessary commits
7. Submit a pull request from your topic branch back to the `main` branch of the main repository
8. Make changes to the pull request if reviewers request them and request a re-review
Pull requests should be focused on a single change. Do not mix, for example, refactorings with a bug fix or implementation of a new feature. This practice makes it easier for fellow contributors to review each pull request. Pull requests should be focused on a single change. Do not mix, for example, refactorings with a bug fix or implementation of a new feature. This practice makes it easier for fellow contributors to review each pull request.