Skip to content

Evaluate modifier refactor#69

Merged
rsgalloway merged 4 commits intomasterfrom
issue59/evaluate-modifiers
Aug 15, 2025
Merged

Evaluate modifier refactor#69
rsgalloway merged 4 commits intomasterfrom
issue59/evaluate-modifiers

Conversation

@rsgalloway
Copy link
Owner

@rsgalloway rsgalloway commented Aug 15, 2025

@rsgalloway rsgalloway linked an issue Aug 15, 2025 that may be closed by this pull request
@rsgalloway rsgalloway self-assigned this Aug 15, 2025
@rsgalloway rsgalloway added the bug Something isn't working label Aug 15, 2025
@rsgalloway rsgalloway added this to the Version 0.9.0 milestone Aug 15, 2025
@rsgalloway rsgalloway changed the title Expansion modifier refactor Evaluate modifier refactor Aug 15, 2025
@rsgalloway rsgalloway marked this pull request as ready for review August 15, 2025 13:34
@rsgalloway rsgalloway requested a review from Copilot August 15, 2025 13:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the expansion modifiers functionality to prevent cyclical reference errors by returning empty strings instead of raising exceptions when cycles are detected. This changes the behavior from strict error handling to a more bash-like approach where cycles resolve to empty strings.

  • Removes the CyclicalReference exception raising behavior and returns empty strings for cyclic references
  • Adds comprehensive cycle detection using a resolving set parameter to track variables currently being resolved
  • Updates all test cases to expect empty strings instead of CyclicalReference exceptions

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
lib/envstack/util.py Complete refactor of evaluate_modifiers function with improved cycle detection and bash-like behavior
lib/envstack/env.py Minor changes to iterate over list copies when modifying dictionaries during iteration
tests/test_util.py Updates test cases to expect empty strings instead of CyclicalReference exceptions
tests/test_env.py Adds new test for issue #59 and fixes formatting/syntax issues in existing tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rsgalloway rsgalloway merged commit df33fc3 into master Aug 15, 2025
@rsgalloway rsgalloway deleted the issue59/evaluate-modifiers branch August 15, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

indirection with expansion modifiers

2 participants