-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add pre-commit hook & contribution guide (#94)
Added support for gofmt pre-commit hook & updated contribution.md file with all the steps to make the contribution. * added pre-commit hook * feat(pre-commit-hook & updated contribution guide): added support for gofmt pre-commit hook & also updated contribution.md file with all the steps * fix:updated permission for scripts Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
- Loading branch information
1 parent
78f8a85
commit 816e0a5
Showing
2 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
echo "Checking for changes!" | ||
|
||
GO_FILES=$(git diff --cached --name-only -- '*.go') | ||
|
||
if [[ $GO_FILES == "" ]]; then | ||
echo "No Go Files to Update" | ||
else | ||
for file in $GO_FILES; do | ||
go fmt $file | ||
git add $file | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters