Repository navigation
feat: warn about namespace references that vendorPackage cannot rename - #75
Open
ehennestad wants to merge 2 commits into
Open
ehennestad wants to merge 2 commits into
ehennestad wants to merge 2 commits into
Conversation
vendorPackage renames the source namespace only in .m files, and only
where "." and a letter or "*" follow the name. A namespace name built at
run time, such as "webprogress." + name or
meta.package.fromName("webprogress"), and every reference in another
file, such as an .mlx file or functionSignatures.json, was left
unchanged without notice. In the copy, such a reference resolves to the
original namespace: it fails when that namespace is not installed, and
runs another version of the code when it is.
After renaming, the copied files are now searched for the source
namespace name as a whole word, and the warning
MatBox:VendorPackage:UnrenamedReferences lists each place found: file
and line for text files, the file alone for binary files. .mlx and
.mlapp files are searched in the files their zip archive holds. Error
identifiers and comment lines of .m files are not reported, and the
license file and vendorinfo.json are added after the search.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Test Results99 tests 99 ✅ 35s ⏱️ Results for commit d86f788. ♻️ This comment has been updated with latest results. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
matbox.tasks.vendorPackagerenames the source namespace only in .m files, and only where "." and a letter or "*" follow the name. Some references do not have that form and stay unchanged without notice:"webprogress." + name,feval("webprogress." + m),meta.package.fromName("webprogress")orstartsWith(class(obj), "webprogress.")resources/functionSignatures.jsonIn the copy, such a reference resolves to the original namespace. It fails when that namespace is not installed, and runs another version of the code when it is.
Change
After renaming, the copied files are searched for the source namespace name as a whole word. The new function
matbox.tasks.internal.findNamespaceReferencesuses the same lookbehind asrenameNamespaceInText, so renamed references, longer names and paths are not reported. If any places are found,vendorPackageFromFolderissues one warning,MatBox:VendorPackage:UnrenamedReferences, that lists them:path:line. Binary files (any file with a NUL byte) are listed by path only.warning.The help text of
vendorPackagedescribes the warning.Limitations
%{ %}blocks and non-.m files are reported.🤖 Generated with Claude Code