New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: exclude external imports #1193
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if someone does something like
import('http_helper')
?I ask this question because I believe you need to test for protocols, not for strings (even though protocols are defined by strings, but it's a stricter check is my point). You'll want a method that tests a single string for a list of protocols. e.g.
I dunno if that works because I suck at regex and always have to run it to verify, but you get the idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the check here 🙂
import("http_utils")
should pass because there wont be a*
in the glob, but I agree its good to improve the check to check for the protocol instead. I've updated the code and added another test. Could you take another look?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good callout, @shellscape. I do think this can be merged as-is, and I don’t want to delay quality work. I also have a suggestion.
Thank you, @thepassle. I would benefit from this change. I also appreciate that you added a test for
http_utils
.I am wondering if this would be easier to maintain? Where;
shouldIgnore
method includes the asterisk check.URL
defaults to a non-ignored file protocol, rather than a try/catch.@thepassle, the changes would look something like this. Thoughts?
If you’re thumbs up on these changes, @thepassle, @shellscape, will you please forgive me for introducing any further delays? And would there be anything I could do to prevent further delaying a merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion @jonathantneal ! I've refactored the code to follow your suggestion. It required one tiny change;
but otherwise fine 🙂