Add githooks to add some validations before commit and/or push an update.
githooks list :
pre-commit : Execute dart format on the lib/ folder. Don't commit files to avoid to split them in 2 commits. It will be easier to have these files in the same commit as the update.
commit-msg : Validate the commit message structure
pre-push : Execute flutter analyze to validate if everything is fine and ready to be pushed.
âď¸ Related Issues
closes: #120
𧪠How to test the change?
Pre-commit
Execute the command git config core.hooksPath .githooks to enable the githooks
Update a .dart file to make it "without a good code format" (like adding a space before ; at the end of a line)
Commit the file
The .dart file must be updated and formatted correctly
Commit-msg
Execute the command git config core.hooksPath .githooks to enable the githooks
Try to commit with the message "toto" and you should have an error
Pre-push
Execute the command git config core.hooksPath .githooks to enable the githooks
Update a .dart file by adding an unused import
Commit the file
Push the commit
The commit must be blocked due to an error related to the unused import
âď¸ Checklist before requesting a review
[x] I have performed a self-review of my code.
[x] I have added/updated tests.
[x] Make sure to add either one of the following labels: version: Major,version: Minor or version: Patch.
đ Description
Add githooks to add some validations before commit and/or push an update.
githooks list :
pre-commit
: Executedart format
on thelib/
folder. Don't commit files to avoid to split them in 2 commits. It will be easier to have these files in the same commit as the update.commit-msg
: Validate the commit message structurepre-push
: Executeflutter analyze
to validate if everything is fine and ready to be pushed.âď¸ Related Issues
closes: #120
𧪠How to test the change?
Pre-commit
git config core.hooksPath .githooks
to enable the githooks.dart
file to make it "without a good code format" (like adding a space before;
at the end of a line).dart
file must be updated and formatted correctlyCommit-msg
git config core.hooksPath .githooks
to enable the githooksPre-push
git config core.hooksPath .githooks
to enable the githooks.dart
file by adding an unused importâď¸ Checklist before requesting a review
version: Major
,version: Minor
orversion: Patch
.