Repository navigation
fix: resolve imports under a dotted package name - #141
Merged
Merged
Conversation
A target whose package name has several segments, such as `app.nodes`, built module paths with the whole dotted name as one segment and looked for its source root by the last folder name only. Imports of the package therefore never matched, so rules that read imported modules (FFL104 and the other import-ownership checks) silently skipped them. Package names are now split into segments, and a source root holds the package when its last folders spell them, as `src/app/nodes` does for `app.nodes`. Single-segment package names behave as before.
kvlonge
enabled auto-merge (squash)
November 23, 2026 16:02
Deploying fensu with
|
| Latest commit: |
aec95a1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fb98740a.fensu.pages.dev |
| Branch Preview URL: | https://fix-dotted-package-name.fensu.pages.dev |
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.
Why
A rule target may use a dotted package name, such as
app.nodes, for a package whose source root issrc/app/nodes. Module paths were built with the whole dotted name as one segment, and source roots were found by their last folder name only, so imports of the package never resolved. FFL104 and the other import-ownership checks then silently skipped them.Changes
NativeRuleContext::package_partssplits the package name into segments, andpackage_root_parentfinds the root whose trailing folders spell them.Verification
test_dotted_package.rs: an import of another domain's private main entry underapp.nodesplans the rightis_filequery and reports FFL104; the same domain's import does not.cargo test -p fensu-native,cargo clippy -p fensu-native --all-targets -- -D warnings,cargo fmt --checkandfensu check --target rustpass.