-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpoe_tasks.toml
More file actions
114 lines (96 loc) · 2.57 KB
/
poe_tasks.toml
File metadata and controls
114 lines (96 loc) · 2.57 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#:schema https://json.schemastore.org/partial-poe.json
[env]
PROTOVALIDATE_VERSION.default = "v1.2.0"
[tasks.add-license-header]
help = "Add license header to all source files"
cmd = """
go run github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@v1.69.0
--ignore .github --ignore buf.yaml
--ignore buf.gen.yaml
--ignore test/conformance/nonconforming.yaml
--license-type apache
--copyright-holder "Buf Technologies, Inc."
--year-range "2023-2026"
"""
[tasks.check]
help = "Run code checks"
sequence = [
"lint",
"test",
"test-conformance",
]
[tasks.diffcheck]
help = "Check for uncommitted or untracked files (guards against codegen regressions)"
shell = "test -z \"$(git status --porcelain | tee /dev/stderr)\""
[tasks.generate]
sequence = [
"generate-cel",
"generate-protovalidate",
"generate-test",
"add-license-header",
]
[tasks.generate-cel]
script = "scripts.generate_cel:main"
[tasks.generate-protovalidate]
script = "scripts.generate_protovalidate:main(environ['PROTOVALIDATE_VERSION'])"
[tasks.generate-test]
sequence = [
{ script = "poethepoet.scripts:rm('test/gen/tests')" },
{ cmd = "buf generate", cwd = "test" },
]
[tasks.format]
help = "Apply all possible auto-formatting to files"
sequence = [
"format-python",
"format-protos",
"format-toml",
"add-license-header"
]
[tasks.format-protos]
help = "Apply auto-formatting to protobuf files"
cmd = "buf format --write"
[tasks.format-python]
help = "Apply auto-formatting to Python files"
sequence = [
{ cmd = "ruff check --fix --unsafe-fixes --exit-zero" },
{ cmd = "ruff format" }
]
[tasks.format-toml]
help = "Apply formatting to TOML files"
cmd = "tombi format"
[tasks.lint]
help = "Apply all possible linting to files"
sequence = [
"lint-python",
"lint-protos",
"lint-toml",
{ cmd = "uv lock --check" }
]
[tasks.lint-protos]
help = "Apply linting to protobuf files"
cmd = "buf format -d --exit-code"
[tasks.lint-python]
help = "Apply linting to Python files"
sequence = [
{ cmd = "ruff check" },
{ cmd = "ruff format --check" },
{ cmd = "ty check protovalidate" },
]
[tasks.lint-toml]
help = "Apply linting to TOML files"
sequence = [
{ cmd = "tombi format --check" },
{ cmd = "tombi lint" },
]
[tasks.test-conformance]
help = "Run the CEL conformance tests"
cmd = """
go run github.com/bufbuild/protovalidate/tools/protovalidate-conformance@${PROTOVALIDATE_VERSION}
--strict_message
--expected_failures=test/conformance/nonconforming.yaml
--timeout 10s
python test/conformance/runner.py
"""
[tasks.test]
help = "Run unit tests"
cmd = "pytest"