feat: enhance rsenv with flexible spacing and standalone file support#1
Merged
feat: enhance rsenv with flexible spacing and standalone file support#1
Conversation
Allow zero or more spaces after the colon in rsenv parent file comments. Previously required exactly one space, now accepts patterns like: - # rsenv:parent.env (no space) - # rsenv: parent.env (one space) - # rsenv: parent.env (multiple spaces) - # rsenv:\tparent.env (tab)
Previously, the leaves command would return empty results for directories containing only standalone environment files (files without rsenv comments). Now standalone files are correctly identified as root nodes and returned as leaves. Changes: - Track all .env files during directory scanning, not just those with parent relationships - Include standalone files (files not part of any parent-child relationship) as root nodes - Update TreeBuilder to create single-node trees for standalone files - Add test coverage for mixed standalone and hierarchical file scenarios
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.
Summary
This PR introduces significant enhancements to rsenv focusing on improved usability, comprehensive documentation, and expanded functionality for standalone environment files.
Key Features
# rsenv:comments.envfiles as single-node treesChanges Made
Core Functionality
# rsenv:parent.env,# rsenv: parent.env,# rsenv: parent.env, etc.)Breaking Changes
None - all changes are backward compatible and enhance existing functionality.
Examples
Flexible Spacing Support
Standalone File Support
# Previously empty, now correctly returns standalone files rsenv leaves environments/ /path/to/standalone.env /path/to/another-standalone.env /path/to/hierarchy-leaf.env