Skip to content

Commit

Permalink
Add optional parameters to manifestYamlStream in linter
Browse files Browse the repository at this point in the history
  • Loading branch information
bison committed Oct 17, 2023
1 parent fed90cd commit f02392d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions linter/internal/types/stdlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func prepareStdlib(g *typeGraph) {
"manifestJsonEx": g.newSimpleFuncType(stringType, "value", "indent"),
"manifestJsonMinified": g.newSimpleFuncType(stringType, "value"),
"manifestYamlDoc": g.newFuncType(stringType, []ast.Parameter{required("value"), optional("indent_array_in_object"), optional("quote_keys")}),
"manifestYamlStream": g.newSimpleFuncType(stringType, "value"),
"manifestYamlStream": g.newFuncType(anyArrayType, []ast.Parameter{required("value"), optional("indent_array_in_object"), optional("c_document_end"), optional("quote_keys")}),
"manifestXmlJsonml": g.newSimpleFuncType(stringType, "value"),

// Arrays
Expand Down Expand Up @@ -152,7 +152,7 @@ func prepareStdlib(g *typeGraph) {
"minArray": g.newFuncType(anyArrayType, []ast.Parameter{required("arr"), optional("keyF")}),
"maxArray": g.newFuncType(anyArrayType, []ast.Parameter{required("arr"), optional("keyF")}),
"contains": g.newSimpleFuncType(boolType, "arr", "elem"),
"avg": g.newSimpleFuncType(numberType, "arr"),
"avg": g.newSimpleFuncType(numberType, "arr"),
"all": g.newSimpleFuncType(boolArrayType, "arr"),
"any": g.newSimpleFuncType(boolArrayType, "arr"),
"remove": g.newSimpleFuncType(anyArrayType, "arr", "elem"),
Expand Down
4 changes: 4 additions & 0 deletions linter/testdata/stdlib_manifestYamlStream.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
std.manifestYamlDoc([
{ foo: "bar" },
{ baz: "qux" },
], indent_array_in_object=false, quote_keys=true)
Empty file.

0 comments on commit f02392d

Please sign in to comment.