Repository navigation
ft/implement variable expansion support - #74
Merged
Merged
Conversation
- Add `VariableExpander` class to handle string variable expansion - Implement nested variable resolution with fallback operators (`:-`, `-`) - Add cycle detection to prevent circular references during expansion - Add unit tests to validate variable expansion in multiple scenarios - Support resolving variables from context or environment variables - Ensure proper handling of escaped variables and unresolved cases
- Add `SupportVariableExpansion` property to `DotEnvOptions` - Update constructor to include `supportVariableExpansion` parameter - Implement `WithSupportVariableExpansion` and `WithoutSupportVariableExpansion` methods - Add alias methods `WithVariableExpansion` and `WithoutVariableExpansion` - Initialise relevant default values for `DotEnvOptions` - Add unit tests to validate new functionality
- Add nullable support to `ReadFileLines` and `ReadStreamLines` - Update `ExtractEnvKeyValues` to support variable expansion - Enhance `Parser.Parse` to handle variable resolution and context - Modify `VariableExpander` for improved null safety and syntax handling - Update `DotEnv.Read` to manage variable expansion across sources - Add unit tests to validate multiple scenarios with variable expansion
- Add `supportVariableExpansion` description in API options - Document `WithSupportVariableExpansion` and alias methods - Expand Fluent builder methods table with variable expansion options - Add detailed section for variable expansion and interpolation - Cover syntax, features, quoting, escaping, and circular dependency detection
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #74 +/- ##
==========================================
+ Coverage 92.55% 95.62% +3.06%
==========================================
Files 6 7 +1
Lines 282 434 +152
Branches 71 120 +49
==========================================
+ Hits 261 415 +154
+ Misses 14 9 -5
- Partials 7 10 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Add tests for backslash handling in `VariableExpander` - Add tests for empty variable names with default operators (`:-`, `-`) - Add tests for nested braces and indirect references in variable expansion - Add tests for resolving variables with null context from environment - Add tests for identifiers with underscores and digits in variable expansion - Add test for handling null options in `DotEnv.Read` - Add parser test to ignore whitespace keys - Add parser test for multiline values with null lines
This was referenced Sep 8, 2026
This was referenced Sep 16, 2026
This was referenced Sep 25, 2026
This was referenced Oct 2, 2026
This was referenced Oct 9, 2026
This was referenced Oct 9, 2026
This was referenced Oct 21, 2026
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.
No description provided.