Skip to content

ft/implement variable expansion support - #74

Merged
bolorundurowb merged 5 commits into
masterfrom
ft/implement-variable-expansion-support
Sep 8, 2026
Merged

bolorundurowb merged 5 commits into
masterfrom
ft/implement-variable-expansion-support

Conversation

@bolorundurowb

Copy link
Copy Markdown
Owner

No description provided.

- 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

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.66082% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.62%. Comparing base (33a4e42) to head (4a4b20d).

Files with missing lines Patch % Lines
src/dotenv.net/VariableExpander.cs 96.80% 0 Missing and 4 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- 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
@bolorundurowb
bolorundurowb merged commit 927650c into master Sep 8, 2026
4 checks passed
@bolorundurowb
bolorundurowb deleted the ft/implement-variable-expansion-support branch September 8, 2026 11:48
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