Skip to content

Add custom_data in formats_override#35

Merged
kunitoki merged 2 commits into
mainfrom
dev/per_output_custom_data
Jun 8, 2026
Merged

Add custom_data in formats_override#35
kunitoki merged 2 commits into
mainfrom
dev/per_output_custom_data

Conversation

@kunitoki

@kunitoki kunitoki commented Jun 8, 2026

Copy link
Copy Markdown
Owner

This pull request adds robust support for per-format and per-output custom_data overrides in the configuration system, allowing users to specify format-specific or output-specific template variables that are deeply merged over global custom_data. The implementation introduces a new custom_data field to FormatOverrideConfig, ensures correct merging logic, and provides comprehensive documentation and tests for the new behavior.

Configuration and Merging Enhancements

  • Added a custom_data field to FormatOverrideConfig and ensured it is parsed, defaulted to {} if absent or null, and deeply merged with the global custom_data when generating for a specific format or output. The merging logic is exposed as merge_yaml_dicts, replacing the previous _merge_yaml_dicts function and updating all usages to the new name. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

Documentation Updates

  • Updated docs/input-file-reference.md to document the new custom_data behavior, including deep merging semantics and YAML examples for global, per-format, and per-output overrides. [1] [2]

Testing Improvements

  • Added extensive tests to verify correct parsing, merging, and defaulting of custom_data in both global and format/output-specific contexts, including deep merge scenarios and CLI integration. [1] [2] [3]

Minor Test and Import Cleanups

  • Added necessary imports in test files and removed redundant ones to support new test cases and maintain clarity. [1] [2] [3] [4]

Other Test Enhancements

  • Improved assertions in existing tests to ensure output files remain unchanged on breaking changes. [1] [2]

@kunitoki kunitoki force-pushed the dev/per_output_custom_data branch from 6afc710 to e435845 Compare June 8, 2026 19:13
@kunitoki kunitoki merged commit 1b2f6f9 into main Jun 8, 2026
45 checks passed
@kunitoki kunitoki deleted the dev/per_output_custom_data branch June 8, 2026 20:05
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

Successfully merging this pull request may close these issues.

1 participant