style(git): enforce conventional commits on git push with a hook (#61)

* style(git): enforce conventional commits on git push with a hook

* docs(contributing): add setup step

* Update changelog

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Alexandre Pasmantier 2024-11-23 17:56:28 +01:00 committed by GitHub
parent b198aebdfc
commit b703e1b26c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 5 deletions

View File

@ -15,6 +15,11 @@ All notable changes to this project will be documented in this file.
### 📚 Documentation
- Terminal emulators compatibility and good first issues (#56)
- *(contributing)* Add setup step
### 🎨 Styling
- *(git)* Enforce conventional commits on git push with a hook
### ⚙️ Miscellaneous Tasks
@ -22,7 +27,7 @@ All notable changes to this project will be documented in this file.
### Build
- *(infer)* Drop infer dependency and refactor code to a simpler heuristic
- *(infer)* Drop infer dependency and refactor code to a simpler heuristic (#58)
## [0.5.1] - 2024-11-20

View File

@ -24,20 +24,24 @@ These are pretty much the only things you need to have installed on your machine
cd television
git remote add upstream https://github.com/alexpasmantier/television.git
```
4. Create a new branch for your feature or bug fix:
4. Install the project dependencies by running the following command:
```shell
make setup
```
5. Create a new branch for your feature or bug fix:
```shell
git checkout -b <branch-name>
```
5. Make your changes and commit them to your branch:
6. Make your changes and commit them to your branch:
```shell
git add .
git commit -m "Your commit message"
```
6. Push your changes to your forked repository:
7. Push your changes to your forked repository:
```shell
git push origin <branch-name>
```
7. Create a pull request by navigating to the original repository and clicking on the `New pull request` button.
8. If not done automatically, create a pull request by navigating to the original repository and clicking on the `New pull request` button.
### Building the project

View File

@ -6,6 +6,10 @@ setup:
@mkdir -p .git/hooks
@echo "make fix" > .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "installing convco..."
@cargo install convco
@echo "make check-commits" > .git/hooks/pre-push
@chmod +x .git/hooks/pre-push
@echo "Done"
clean:
@ -58,3 +62,7 @@ publish:
update-changelog:
@echo "Updating changelog"
@git cliff -o CHANGELOG.md
check-commits:
@echo "Checking commits (see https://www.conventionalcommits.org/)"
@convco check origin/main..HEAD