You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: PackageHallucinationScorer misses indented Perl and Raku use statements #4751
PackageHallucinationScorer with ecosystem=PackageEcosystem.PERL or PackageEcosystem.RAKU does not extract a module when its use statement is indented. Raku's need, import and require have the same problem.
The Perl pattern is (?:`{3}|^)use\s+... and the Raku pattern is (?:`{3}|^)(?:use|need|import|require)\s+..., both with re.MULTILINE. They only match when the keyword is the first character on the line, so these cases are missed:
a use inside a BEGIN { ... } block, a sub, or an if block
an indented Markdown code block, for example one inside a numbered list item
When the only reference to a hallucinated module is indented, the scorer returns False. The Python and Ruby patterns already allow leading whitespace (^[ \t]*import, ^[ \t]*require). Python got this in #2955.
#4752 by Shivam Sharma (@ShivamSharma43), who reported this, is the implementation we're keeping. Closing #4753 as a duplicate: it makes the same change and was opened afterwards.
To avoid duplicated effort, please check for an existing issue and PR, and claim an issue by comment before starting work, so maintainers can coordinate.
Activity
romanlutz commentedon Nov 30, 2026
#4752 by Shivam Sharma (@ShivamSharma43), who reported this, is the implementation we're keeping. Closing #4753 as a duplicate: it makes the same change and was opened afterwards.
To avoid duplicated effort, please check for an existing issue and PR, and claim an issue by comment before starting work, so maintainers can coordinate.