@@ -82,27 +82,11 @@ $(TOOLS_BIN)/goimports: $(TOOLS_DB)/goimports.$(GOIMPORTS_VER).$(GO_VER).ver
82
82
83
83
.PHONY : goimports
84
84
goimports : $(TOOLS_BIN ) /goimports
85
- @echo ' $(TOOLS_BIN)/goimports -l `$(GO_FILES)`'
86
- @if [[ -n " $$ ($( TOOLS_BIN) /goimports -l ` $( GO_FILES) ` | tee /dev/stderr)" ]]; then \
87
- echo ' goimports errors' ; \
88
- echo ' ' ; \
89
- echo -e " \e[0;34m→\e[0m To display the needed changes run:" ; \
90
- echo ' make goimports.display' ; \
91
- echo ' ' ; \
92
- echo -e " \e[0;34m→\e[0m To fix them run:" ; \
93
- echo ' make goimports.fix' ; \
94
- echo ' ' ; \
95
- exit 1; \
96
- fi
97
- @echo ' '
85
+ $(TOOLS_BIN ) /goimports -w ` $( GO_FILES) `
98
86
99
87
.PHONY : goimports.display
100
88
goimports.display : $(TOOLS_BIN ) /goimports
101
- $(TOOLS_BIN ) /goimports -d ` $( GO_FOLDERS) `
102
-
103
- .PHONY : goimports.fix
104
- goimports.fix : $(TOOLS_BIN ) /goimports
105
- $(TOOLS_BIN ) /goimports -w ` $( GO_FOLDERS) `
89
+ $(TOOLS_BIN ) /goimports -d ` $( GO_FILES) `
106
90
# # </goimports>
107
91
108
92
# # <gofumpt>
@@ -114,53 +98,21 @@ $(TOOLS_BIN)/gofumpt: $(TOOLS_DB)/gofumpt.$(GOFUMPT_VER).$(GO_VER).ver
114
98
115
99
.PHONY : gofumpt
116
100
gofumpt : $(TOOLS_BIN ) /gofumpt
117
- @echo ' $(TOOLS_BIN)/gofumpt -l `$(GO_FOLDERS)`'
118
- @if [[ -n " $$ ($( TOOLS_BIN) /gofumpt -l ` $( GO_FOLDERS) ` | tee /dev/stderr)" ]]; then \
119
- echo ' gofumpt errors' ; \
120
- echo ' ' ; \
121
- echo -e " \e[0;34m→\e[0m To display the needed changes run:" ; \
122
- echo ' make gofumpt.display' ; \
123
- echo ' ' ; \
124
- echo -e " \e[0;34m→\e[0m To fix them run:" ; \
125
- echo ' make gofumpt.fix' ; \
126
- echo ' ' ; \
127
- exit 1; \
128
- fi
129
- @echo ' '
101
+ $(TOOLS_BIN ) /gofumpt -w ` $( GO_FILES) `
130
102
131
103
.PHONY : gofumpt.display
132
104
gofumpt.display :
133
- $(TOOLS_BIN ) /gofumpt -d ` $( GO_FOLDERS) `
134
-
135
- .PHONY : gofumpt.fix
136
- gofumpt.fix :
137
- $(TOOLS_BIN ) /gofumpt -w ` $( GO_FOLDERS) `
105
+ $(TOOLS_BIN ) /gofumpt -d ` $( GO_FILES) `
138
106
# # </gofumpt>
139
107
140
108
# # <gofmt>
141
109
.PHONY : gofmt
142
110
gofmt :
143
- @echo ' gofmt -l `$(GO_FOLDERS)`'
144
- @if [[ -n " $$ (gofmt -l ` $( GO_FOLDERS) ` | tee /dev/stderr)" ]]; then \
145
- echo ' gofmt errors' ; \
146
- echo ' ' ; \
147
- echo -e " \e[0;34m→\e[0m To display the needed changes run:" ; \
148
- echo ' make gofmt.display' ; \
149
- echo ' ' ; \
150
- echo -e " \e[0;34m→\e[0m To fix them run:" ; \
151
- echo ' make gofmt.fix' ; \
152
- echo ' ' ; \
153
- exit 1; \
154
- fi
155
- @echo ' '
111
+ gofmt -w ` $( GO_FILES) `
156
112
157
113
.PHONY : gofmt.display
158
114
gofmt.display :
159
- gofmt -d ` $( GO_FOLDERS) `
160
-
161
- .PHONY : gofmt.fix
162
- gofmt.fix :
163
- gofmt -w ` $( GO_FOLDERS) `
115
+ gofmt -d ` $( GO_FILES) `
164
116
# # </gofmt>
165
117
166
118
# # <gojq>
@@ -186,6 +138,19 @@ air: $(TOOLS_BIN)/air
186
138
@exec $(TOOLS_BIN ) /air -c .air.toml
187
139
# # </air>
188
140
141
+ # # <mockery>
142
+ # https://github.com/vektra/mockery/releases
143
+ MOCKERY_CMD: =github.com/vektra/mockery/v2
144
+ MOCKERY_VER: =v2.45.1
145
+ $(TOOLS_BIN ) /mockery : $(TOOLS_DB ) /mockery.$(MOCKERY_VER ) .$(GO_VER ) .ver
146
+ $(call go_install,air,$(MOCKERY_CMD ) ,$(MOCKERY_VER ) )
147
+
148
+ .PHONY : mockery
149
+ mockery : $(TOOLS_BIN ) /mockery
150
+ grep --recursive --files-with-matches ' // Code generated by mockery' . | grep -v ' scripts/tools.mk' | grep -v ' bin/mockery' | xargs rm || true
151
+ mockery --config=.mockery.yml
152
+ # # </mockery>
153
+
189
154
# # <protobuf>
190
155
# https://github.com/protocolbuffers/protobuf/releases
191
156
PROTOC_VER: =v27.3
0 commit comments