mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-27 18:55:54 -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>
87 lines
2.1 KiB
YAML
87 lines
2.1 KiB
YAML
---
|
|
cases:
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("")
|
|
}
|
|
note: units_parse_bytes/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse_bytes: no byte amount provided"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("GB")
|
|
}
|
|
note: units_parse_bytes/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse_bytes: no byte amount provided"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("foo")
|
|
}
|
|
note: units_parse_bytes/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse_bytes: no byte amount provided"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("0.0.0")
|
|
}
|
|
note: units_parse_bytes/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse_bytes: could not parse byte amount to a number"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes(".5.2")
|
|
}
|
|
note: units_parse_bytes/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse_bytes: could not parse byte amount to a number"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes("100 kb")
|
|
}
|
|
note: units_parse_bytes/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse_bytes: spaces not allowed in resource strings"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse_bytes(" 327MiB ")
|
|
}
|
|
note: units_parse_bytes/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse_bytes: spaces not allowed in resource strings"
|
|
strict_error: true
|