@@ -11,7 +11,7 @@ current_dir := $(dir $(mkfile_path))
11
11
# Global stuff.
12
12
13
13
GO =$(shell which go)
14
- HOMEBREW_PACKAGES =bash bats-core coreutils findutils git git-lfs go grep jq librsvg nodejs pre-commit python@3.11 tfschema trufflesecurity/trufflehog/trufflehog
14
+ HOMEBREW_PACKAGES =bash bats-core coreutils findutils git git-lfs go grep jq librsvg nodejs pre-commit python@3.11 shellcheck tfschema trufflesecurity/trufflehog/trufflehog
15
15
16
16
# Determine the operating system and CPU arch.
17
17
OS =$(shell uname -o | tr '[:upper:]' '[:lower:]')
@@ -66,6 +66,7 @@ install-tools-go:
66
66
$(GO ) install github.com/nikolaydubina/go-cover-treemap@latest
67
67
$(GO ) install github.com/orlangure/gocovsh@latest
68
68
$(GO ) install github.com/pelletier/go-toml/v2/cmd/tomljson@latest
69
+ $(GO ) install github.com/rhysd/actionlint/cmd/actionlint@latest
69
70
$(GO ) install github.com/securego/gosec/v2/cmd/gosec@latest
70
71
$(GO ) install github.com/trufflesecurity/driftwood@latest
71
72
$(GO ) install golang.org/x/perf/cmd/benchstat@latest
@@ -210,32 +211,6 @@ binsize:
210
211
# -------------------------------------------------------------------------------
211
212
# Linting
212
213
213
- .PHONY : vuln
214
- # # vuln: [lint]* Checks for known security vulnerabilities.
215
- vuln :
216
- @ $(ECHO ) " "
217
- @ $(ECHO ) " \033[1;33m=====> Running govulncheck (https://go.dev/blog/vuln)...\033[0m"
218
- govulncheck ./...
219
-
220
- @ $(ECHO) " "
221
- @ $(ECHO) "\033[1;33m=====> Running govulncheck -test (https://go.dev/blog/vuln)...\033[0m"
222
- govulncheck -test ./...
223
-
224
- @ $(ECHO) " "
225
- @ $(ECHO) "\033[1;33m=====> Running osv-scanner (https://osv.dev)...\033[0m"
226
- osv-scanner -r .
227
-
228
- @ $(ECHO) " "
229
- @ $(ECHO) "\033[1;33m=====> Running gosec (https://github.com/securego/gosec)...\033[0m"
230
- gosec -terse -tests ./...
231
-
232
- .PHONY : secrets
233
- # # secrets: [lint]* Checks for verifiable secrets.
234
- secrets :
235
- @ $(ECHO ) " "
236
- @ $(ECHO ) " \033[1;33m=====> Running TruffleHog...\033[0m"
237
- trufflehog git file://. --json --only-verified --concurrency=$(nproc ) 2> /dev/null | jq ' .'
238
-
239
214
.PHONY : pre-commit
240
215
# # pre-commit: [lint]* Runs `pre-commit` against all files.
241
216
pre-commit :
@@ -265,16 +240,9 @@ license:
265
240
@ - licensei header
266
241
@ $(ECHO) " "
267
242
268
- .PHONY : unconvert
269
- # # unconvert: [lint]* Identify unnecessary type conversions. All GOOS/GOARCH matches.
270
- unconvert :
271
- @ $(ECHO ) " "
272
- @ $(ECHO ) " \033[1;33m=====> Running unconvert (all GOOS/GOARCH)...\033[0m"
273
- unconvert -all -fastmath -tests -v ./...
274
-
275
243
.PHONY : lint
276
244
# # lint: [lint]* Runs ALL linting/validation tasks.
277
- lint : vuln license unconvert pre-commit
245
+ lint : license pre-commit
278
246
279
247
# -------------------------------------------------------------------------------
280
248
# Testing
@@ -307,7 +275,7 @@ list-tests:
307
275
308
276
@ $(ECHO) " "
309
277
@ $(ECHO) "\033[1;33m=====> Fuzzing tests...\033[0m"
310
- @ cat ./corefunc/*_test.go | ggrep "func Fuzz" | gsed 's/func\s//g' | gsed -r 's/\(.*//g' | gsed -r 's/Fuzz/ make fuzz NAME=/g'
278
+ @ $(ECHO) " make fuzz"
311
279
312
280
@ $(ECHO) " "
313
281
@ $(ECHO) "\033[1;33m=====> BATS tests...\033[0m"
@@ -358,11 +326,13 @@ examples:
358
326
gotestsum --format testname -- -run=Example$(NAME ) -count=1 -parallel=$(shell nproc) -timeout 30s -coverpkg=./corefunc/... -coverprofile=__coverage.out -v ./corefunc/...
359
327
360
328
.PHONY : fuzz
361
- # # fuzz: [test]* Runs the fuzzer for 10 minutes. Set NAME= (without 'Fuzz') to run a specific test by name
329
+ # # fuzz: [test]* Runs the fuzzer for 1 minute per test.
362
330
fuzz :
363
331
@ $(ECHO ) " "
364
332
@ $(ECHO ) " \033[1;33m=====> Running the fuzzer (https://go.dev/doc/tutorial/fuzz)...\033[0m"
365
- $(GO ) test -run=' ^$$' -fuzz=Fuzz$(NAME ) -fuzztime 10m -parallel=$(shell nproc) -v ./corefunc/...
333
+ $(GO ) test -run=' ^$$' -fuzz=FuzzEnvEnsure -fuzztime 1m -v ./corefunc
334
+ $(GO ) test -run=' ^$$' -fuzz=FuzzStrIterativeReplace -fuzztime 1m -v ./corefunc
335
+ $(GO ) test -run=' ^$$' -fuzz=FuzzTruncateLabel -fuzztime 1m -v ./corefunc
366
336
367
337
.PHONY : quickbench
368
338
# # quickbench: [test]* Runs the benchmarks with minimal data for a quick check
0 commit comments