Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go implementation missing a new line to generated yaml files #675

Open
sj14 opened this issue Mar 22, 2023 · 0 comments
Open

Go implementation missing a new line to generated yaml files #675

sj14 opened this issue Mar 22, 2023 · 0 comments

Comments

@sj14
Copy link

sj14 commented Mar 22, 2023

At work, we figured out that go-jsonnet is not adding a new line at the end of a generated file, while jsonnet does.
This is somewhat of a problem as we use it in a CI pipeline and compare differences to the generated files, and sometimes people install jsonnet instead of go-jsonnet. It would be nice when go-jsonnet also adds the new line at the end of a generated file.

We create the files with the manifestYamlDoc function.

Reproducible example of the jsonnet file:

local workflows = {
  'example.yaml': {
    name: 'example',
  },
};

{
  [filename]:
    std.manifestYamlDoc(
      workflows[filename],
      indent_array_in_object=true,
      quote_keys=false,
    )
  for filename in std.objectFields(workflows)
}

And go-jsonnet is called like this:

jsonnet -S --multi ./output-folder ./input.jsonnet
@sj14 sj14 changed the title Go implementation not adding a new line to the file Go implementation not adding a new line to generated yaml files Mar 22, 2023
@sj14 sj14 changed the title Go implementation not adding a new line to generated yaml files Go implementation missing a new line to generated yaml files Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant