Repository navigation
Expand file tree
/
Copy pathmise.toml
More file actions
80 lines (67 loc) · 1.89 KB
/
Copy pathmise.toml
File metadata and controls
80 lines (67 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
[tools]
aws-sam = { version = "1.166.1", symlink_bins = "true" }
caddy = "2.11.4"
go = "1.26.10"
ruff = "0.16.6"
[tasks.test]
description = "Run the Go test suite"
usage = 'flag "--race" help="Run tests with the race detector"'
run = 'go test {% if usage.race %}-race {% endif %}./...'
[tasks.sam-lambda]
description = "Start the local SAM Lambda Invoke API"
run = "sam local start-lambda --template testapp/template.yaml --host 127.0.0.1 --port ${SAM_PORT:-3001}"
[tasks.e2e]
description = "Build the SAM fixture and run E2E tests"
run = [
"sam build --template-file testapp/template.yaml",
"go test ./test/e2e -count=1",
]
[tasks.format]
description = "Format Go, Python, and Caddyfile code"
usage = 'flag "--check" help="Fail instead of formatting code"'
run = '''
go_files=$(find . -name '*.go' -type f -print)
caddy_files=$(find . -name 'Caddyfile' -type f -print)
{% if usage.check %}
test -z "$(gofmt -l $go_files)"
ruff format --diff testapp/lambda
for f in $caddy_files; do
caddy fmt --diff "$f"
done
{% else %}
gofmt -w $go_files
ruff format testapp/lambda
for f in $caddy_files; do
caddy fmt --overwrite "$f"
done
{% endif %}
'''
[tasks.lint]
description = "Lint Go and Python code"
usage = 'flag "--check" help="Fail instead of formatting code"'
run = '''
go_files=$(find . -name '*.go' -type f -print)
{% if usage.check %}
test -z "$(gofmt -l $go_files)"
{% else %}
gofmt -w $go_files
{% endif %}
{% if usage.check %}
ruff check testapp/lambda
{% else %}
ruff check --fix testapp/lambda
{% endif %}
go vet ./...
'''
[tasks.vet]
description = "Run Go vet"
run = "go vet ./..."
[tasks.vuln]
description = "Scan dependencies for known vulnerabilities"
run = "go run golang.org/x/vuln/cmd/govulncheck@v1.7.0 ./..."
[tasks.check]
description = "Run formatting, vet, and tests"
depends = ["lint", "test"]
[tasks.fmt-check]
description = "Verify Go formatting"
run = "test -z \"$(gofmt -l .)\""