mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-27 02:34:52 -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.0 KiB
YAML
87 lines
2.0 KiB
YAML
---
|
|
cases:
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse("")
|
|
}
|
|
note: units_parse/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse: no amount provided"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse("G")
|
|
}
|
|
note: units_parse/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse: no amount provided"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse("foo")
|
|
}
|
|
note: units_parse/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse: no amount provided"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse("0.0.0")
|
|
}
|
|
note: units_parse/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse: could not parse amount to a number"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse(".5.2")
|
|
}
|
|
note: units_parse/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse: could not parse amount to a number"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse("100 k")
|
|
}
|
|
note: units_parse/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse: spaces not allowed in resource strings"
|
|
strict_error: true
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
p {
|
|
units.parse(" 327Mi ")
|
|
}
|
|
note: units_parse/failure
|
|
query: data.test.p = x
|
|
want_error_code: eval_builtin_error
|
|
want_error: "units.parse: spaces not allowed in resource strings"
|
|
strict_error: true
|