Skip to content

Commit

Permalink
Add optional parameters to manifestYamlStream in linter (google#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
bison authored Jun 10, 2024
1 parent 94a40b2 commit 3d9a2bf
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 @@ -124,7 +124,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 @@ -153,7 +153,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 3d9a2bf

Please sign in to comment.