Add asdf provider detection - #27
Conversation
WalkthroughThis change adds asdf provider detection to the default provider rules by introducing pattern matching for asdf-specific paths (.asdf/shims and .asdf/installs), alongside a corresponding test case to verify correct provider precedence detection for asdf installations. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related issues
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/test_why_core.nim (1)
88-95: Test correctly verifies asdf precedence.The test accurately verifies that asdf shims are detected before system paths, confirming the intended rule precedence.
Optional: Consider adding test coverage for the .asdf/installs pattern
The current test only verifies the
.asdf/shimspattern. You could add another test case for the.asdf/installspattern to ensure comprehensive coverage:test "asdf installs path is detected as asdf provider": let rules = defaultRules("/home/test") let provider = detectProviderByPath( "/home/test/.asdf/installs/nodejs/20.0.0/bin/node", "/home/test/.asdf/installs/nodejs/20.0.0/bin/node", rules ) check provider == "asdf"
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/why_core.nim(1 hunks)tests/test_why_core.nim(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test (macos-latest)
🔇 Additional comments (1)
src/why_core.nim (1)
60-62: LGTM! asdf provider rule correctly implemented.The asdf provider rule is well-positioned and uses appropriate patterns. The placement after Mise and before Snap ensures proper precedence, particularly before the System provider as intended by the PR objectives.
Summary
Testing
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.