Skip to content

Add configuration setting to control newline characters in metadata.#8439

Merged
mikf merged 4 commits intomikf:masterfrom
featherbutt:newline
Oct 21, 2025
Merged

Add configuration setting to control newline characters in metadata.#8439
mikf merged 4 commits intomikf:masterfrom
featherbutt:newline

Conversation

@featherbutt
Copy link
Contributor

This adds the configuration option metadata.newline, which behaves like output.stdout.newline, but for generated metadata files.

The option is forwarded to calls to open when writing metadata.

Alternative solutions considered:

  • Manually replace newlines in the metadata instead of having open do it, then passing newline='' to open
  • Add a metadata.reconfigure field instead that gets passed to a call to TextWrapperIO.reconfigure

The current implementation is the cleanest and simplest, but has one downside: because the tests use mocks for calls to open, the tests can verify that the newline argument was passed but can't test the effect it has on the output.

@mikf mikf merged commit 06e3126 into mikf:master Oct 21, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants