Files
Philip Conrad 63e1877c48 linters+testdata: Reformat all yaml testcases for linting. (#6511)
This commit adds a config for yamllint, mass-reformats all of
the existing Yaml testcases to pass linting, and adds a Yaml
linting job to the pull-request Github Actions workflow. A few 
careful exceptions and ignores were added to the linter's
config to allow keeping our existing Yaml files with minimal
reformatting.

Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
2024-01-10 13:16:01 -05:00

72 lines
1.3 KiB
YAML

---
cases:
- data: {}
input_term: '{"foo": {{1}}}'
modules:
- |
package z
p {
data.a[i] = x
input.req1.foo = x
input.req2.bar = x
data.z.q[x]
}
q[x] {
input.req1.foo = x
input.req2.bar = x
data.z.r[x]
}
r[x] {
__local1__ = input.req2.bar
__local2__ = input.req1.foo
{"bar": [x], "foo": __local1__} = {"bar": [__local2__], "foo": x}
}
s {
input.req3.a.b.x[0] = 1
}
t {
input.req4.a.b.x[0] = 1
}
u[x] {
input.req3.a.b[_] = x
x > 1
}
w = [[1, 2], [3, 4]]
gt1 {
__local3__ = input.req1
__local3__ > 1
}
keys[x] = y {
data.numbers[_] = x
to_number(x, y)
}
loopback = __local0__ {
true
__local0__ = input
}
sets {
input.foo[{1}][1] = 1
}
- |
package topdown_test_partial
__result__ = _result {
input.req4.a.b.x[0] = 1
_result = true
}
note: inputvalues/input set
query: data.z.sets = x
want_result:
- x: true