Repository navigation
Conversation
Preserve string context for embedded scalars and original types for standalone placeholders. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #177.
Preserve surrounding text when interpolating integer, boolean, or float values into a string. Return the original scalar type only when the entire string is exactly that placeholder.
Add regression coverage for nested references, zero, negative integers, floats, both booleans, repeated placeholders, and multiple placeholders in either dictionary order.
Type of Change
Testing
Validation on macOS, Python 3.13:
.venv/bin/python -m pytest tests/test_interpolation.py -k 'scalar_interpolation' -q— confirmed all eight new cases fail before the fix..venv/bin/python -m pytest tests/test_interpolation.py tests/test_edge_cases.py tests/test_config_generator.py -q— passed, 109 tests..venv/bin/python -m pytest tests/ -q --cov=himl --cov-report=term-missing --cov-fail-under=80— passed, 268 tests; 92.60% coverage.PATH="$PWD/.venv/bin:$PATH" make lint— passed; fatal flake8 checks and mypy are clean. The advisory flake8 pass reports existing E501/F841 warnings, including duplicate reports from a local ignored worktree.git diff --check— passed.foo.yamlandbaz.yamlfiles throughConfigProcessor.process— passed: mixed interpolation produceshello 42 world, and standalone interpolation remains integer42.Checklist
Additional Notes
No new dependencies, configuration, or public APIs. Comments and documentation changes are unnecessary for this localized bug fix; no downstream changes are required.
The multi-version CI matrix and Docker build were not run locally.