mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-28 11:15:32 -06:00
63e1877c48
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>
113 lines
2.4 KiB
YAML
113 lines
2.4 KiB
YAML
---
|
|
cases:
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("8kb") > units.parse_bytes("7kb")
|
|
}
|
|
note: units_parse_bytes/comparison
|
|
query: data.test.p = x
|
|
want_result:
|
|
- x: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("8gb") > units.parse_bytes("8mb")
|
|
}
|
|
note: units_parse_bytes/comparison
|
|
query: data.test.p = x
|
|
want_result:
|
|
- x: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("1234kb") < units.parse_bytes("1gb")
|
|
}
|
|
note: units_parse_bytes/comparison
|
|
query: data.test.p = x
|
|
want_result:
|
|
- x: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("1024") == units.parse_bytes("1KiB")
|
|
}
|
|
note: units_parse_bytes/comparison
|
|
query: data.test.p = x
|
|
want_result:
|
|
- x: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("2MiB") == units.parse_bytes("2097152")
|
|
}
|
|
note: units_parse_bytes/comparison
|
|
query: data.test.p = x
|
|
want_result:
|
|
- x: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("3MiB") > units.parse_bytes("3MB")
|
|
}
|
|
note: units_parse_bytes/comparison
|
|
query: data.test.p = x
|
|
want_result:
|
|
- x: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("2MiB") == units.parse_bytes("2Mi")
|
|
}
|
|
note: units_parse_bytes/comparison
|
|
query: data.test.p = x
|
|
want_result:
|
|
- x: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("4Mi") > units.parse_bytes("4M")
|
|
}
|
|
note: units_parse_bytes/comparison
|
|
query: data.test.p = x
|
|
want_result:
|
|
- x: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("4.1Mi") > units.parse_bytes("4Mi")
|
|
}
|
|
note: units_parse_bytes/comparison
|
|
query: data.test.p = x
|
|
want_result:
|
|
- x: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("128Gi") == units.parse_bytes("137438953472")
|
|
}
|
|
note: units_parse_bytes/comparison
|
|
query: data.test.p = x
|
|
want_result:
|
|
- x: true
|