Skip to content

Commit 0b9e96d

Browse files
committed
fix: integrate with make
1 parent e765f67 commit 0b9e96d

File tree

4 files changed

+15
-27
lines changed

4 files changed

+15
-27
lines changed

.lintstagedrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"**/*.{js,jsx,ts,tsx,json,md}": ["prettier --write"],
33
"**/*.js": ["jest --findRelatedTests --passWithNoTests"],
44
"tools/spectral/ipa/**/*.yaml": ["node tools/spectral/ipa/scripts/generateRulesetReadme.js"],
5-
"**/*.go": ["./tools/hooks/golang-precommit.sh"]
5+
"**/*.go": ["./tools/cli/precommit.sh"]
66
}

tools/cli/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ gen-mocks: ## Generate mocks
8787
@echo "==> Generating mocks"
8888
go generate ./internal...
8989

90+
.PHONY: pre-commit
91+
pre-commit: fmt lint unit-test ## Run pre-commit checks
92+
9093
.PHONY: help
9194
.DEFAULT_GOAL := help
9295
help:

tools/cli/precommit.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# Get the root directory of the project
5+
ROOT_DIR=$(git rev-parse --show-toplevel)
6+
7+
pushd "$ROOT_DIR/tools/cli"
8+
make pre-commit
9+
popd
10+
11+
exit 0

tools/hooks/golang-precommit.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)