Fix cd environment variable expansion#56
Conversation
|
Before I take this out of draft:
Fix the CI status and add that note, and it’s good to go. |
📝 WalkthroughWalkthroughCLI cd path normalization now expands environment variables (in addition to ~). Two tests were added: one verifies expansion of env-var targets, the other verifies trailing whitespace after an env-var target is stripped and still resolved. Changescd command environment variable expansion
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Follow-up verification:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@trushell/cli.py`:
- Line 287: Trailing whitespace on the parsed argument causes inconsistent path
expansion; update the target computation to strip whitespace from the variable
argument before calling os.path.expanduser/expandvars so it matches kernel and
commands behavior (see _split_command which can leave trailing spaces) — change
the logic that assigns target (currently using argument) to use a stripped
argument, ensuring the existing check that uses argument.strip() remains
consistent with this expansion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 53ee447b-7803-42d9-bc42-b3c7507c119c
📒 Files selected for processing (2)
tests/test_cli_cd.pytrushell/cli.py
Summary:
Validation:
python -m pytest tests/test_cli_cd.py -qRelated issue:
Risk: