Skip to content

Commit 3bae73f

Browse files
committed
update mockery config
1 parent 5434123 commit 3bae73f

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

.mockery.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
packages:
22
github.com/spacemagneto/compressjson:
33
config:
4-
all: True
4+
dir: "{{.InterfaceDir}}"
5+
filename: "mocks/mocks.go"
6+
structname: "{{.Mock}}{{.InterfaceName}}"
57
interfaces:
68
Transcoder:
79
config:

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This Makefile defines common tasks for a Go project, including linting the code,
2+
# running tests, and generating mocks using mockery.
3+
4+
# Target: lint
5+
# Description: Run the Go linter using golangci-lint.
6+
# This checks the code for stylistic issues, potential bugs, and other improvements.
7+
lint: ## Run linter
8+
golangci-lint run
9+
10+
# Target: test
11+
# Description: Run all tests in the project.
12+
# The -v flag makes the test output verbose, showing detailed information about each test.
13+
test: ## Run tests
14+
go test -v ./...
15+
16+
# Target: generate
17+
# Description: Generate code, particularly mocks using mockery.
18+
# If mockery is not installed, this will install it first, and then run go generate.
19+
generate: ## Generate mocks
20+
# Check if mockery is installed. If not, install it.
21+
ifeq (, $(shell which mockery))
22+
go install github.com/vektra/mockery
23+
endif
24+
# Run go generate to trigger code generation in the project.
25+
mockery

0 commit comments

Comments
 (0)