Repository navigation
Conversation
A reference names a key of its own section or of the default section, as before. When neither has the name, it's split at the last dot into a section and a key, so %(db.port)s reads port in [db] (#286).
This branch has not been deployed
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.
Describe the pull request
%(name)scould only refer to a key of the same section or of the default section. A reference can now name a key in any section as%(section.key)s:Lookup order, so existing files keep their meaning:
namein the reference's own section, then in the default section, as before. A key whose name contains a dot, such asdb.host = x, still wins.%(db.replica.port)sreadsportin the child section[db.replica].The existing limits on depth, substitution count and expanded length apply, so
%(x.a)s↔%(y.b)scycles stop.Link to the issue: closes #286
Checklist
AI usage
Written by Amp (an AI coding agent) at the maintainer's request. Validation:
go test ./...,go vet, 20 s ofFuzzWriteRoundTrip, and a scratch check withCaseInsensitive. The new test covers child sections, dotted key names taking precedence in the own and default sections, missing keys, a self-reference and a cross-section cycle. The reference cases fail onmain.