mirror of
https://github.com/google/go-jsonnet.git
synced 2026-05-05 03:56:11 +02:00
Teach jsonnet-lint about optional parameters of std.manifestYamlDoc (#705)
manifestYamlDoc takes two optional parameters, `indent_array_in_object` and `quote_keys`. This commit teaches jsonnet-lint about them so that it doesn't raise errors when you use them. There are other stdlib library functions with this problem; the true solution is probably to auto-generate this from the stdlib AST, but this at least gets the linter happy with this particular function.
This commit is contained in:
parent
16a10df1a7
commit
9639773cf0
@ -120,7 +120,7 @@ func prepareStdlib(g *typeGraph) {
|
||||
"manifestTomlEx": g.newSimpleFuncType(stringType, "value", "indent"),
|
||||
"manifestJsonEx": g.newSimpleFuncType(stringType, "value", "indent"),
|
||||
"manifestJsonMinified": g.newSimpleFuncType(stringType, "value"),
|
||||
"manifestYamlDoc": 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"),
|
||||
"manifestXmlJsonml": g.newSimpleFuncType(stringType, "value"),
|
||||
|
||||
|
||||
3
linter/testdata/stdlib_manifestYamlDoc.jsonnet
vendored
Normal file
3
linter/testdata/stdlib_manifestYamlDoc.jsonnet
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
std.manifestYamlDoc({
|
||||
hello: 'world',
|
||||
}, indent_array_in_object=false, quote_keys=true)
|
||||
0
linter/testdata/stdlib_manifestYamlDoc.linter.golden
vendored
Normal file
0
linter/testdata/stdlib_manifestYamlDoc.linter.golden
vendored
Normal file
Loading…
x
Reference in New Issue
Block a user