Support Moodle cloning from local repo#376
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for cloning Moodle from local repositories in addition to remote Git URLs. The validation logic now accepts file:// URLs and various directory path formats (absolute, relative, and home directory paths), making the behavior consistent with git clone.
Changes:
- Enhanced URL validation to accept local repository paths (file://, absolute, relative, and ~ paths)
- Updated documentation to reflect local repository support
- Added test cases for the new local path formats
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Validate.php | Added validation logic for file:// URLs and directory paths before falling back to standard git URL validation |
| tests/ValidateTest.php | Added test cases for valid local path formats and updated invalid URL test cases with clarifying comments |
| src/Command/InstallCommand.php | Updated --repo option description to mention local path support |
| docs/CLI.md | Updated --repo documentation to mention local path support |
| docs/CHANGELOG.md | Added changelog entry documenting the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #376 +/- ##
============================================
+ Coverage 88.24% 88.26% +0.02%
- Complexity 764 767 +3
============================================
Files 77 77
Lines 2330 2334 +4
============================================
+ Hits 2056 2060 +4
Misses 274 274 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes #306