Skip to content

Commit

Permalink
test:pre commit
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush7833 committed Jun 9, 2024
1 parent 313f4b4 commit 54259bd
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/hooks/pre-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

# Run Go linter
echo "Running golangci-lint..."
golangci-lint run
if [ $? -ne 0 ]; then
echo "Linting failed. Please fix the issues before committing."
exit 1
fi

# Run Go tests
echo "Running go test..."
cd test
go test ./...go test -run TestOrder
if [ $? -ne 0 ]; then
echo "Tests failed. Please fix the issues before committing."
exit 1
fi

echo "All checks passed. Proceeding with commit."
exit 0
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"devDependencies": {
"husky": "^9.0.11"
}
}

0 comments on commit 54259bd

Please sign in to comment.